A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-April/023698.html below:

[Python-Dev] Use for enumerate()

[Python-Dev] Use for enumerate() [Python-Dev] Use for enumerate()holger krekel pyth@devel.trillke.net
Sat, 27 Apr 2002 02:47:19 +0200
On Fri, Apr 26, 2002 at 05:26:59PM -0400, Guido van Rossum wrote:

> Challenge 2: do it with less code.

and more functionality (you can pass -1,-2...):

def getline(filename, lineno):
	l=['']
	if lineno:
		f=open(filename)
		l+=f.read().split('\n')
		f.close()
	return l[len(l)>abs(lineno) and lineno]

regards,

	holger




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