> > > > Challenge 3: do it faster and with less code. > > it should work even if the file is too large > > to fit in memory (as long as each individual line fits in memory). def getline(filename, lineno): if lineno < 1: return '' f = open(filename) g = f.readline return (reduce(lambda x,y: g(), range(lineno), ''), f.close())[0] This incorporates a couple of ideas inspired by Tim's post. Raymond Hettinger
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4