Need help with list of fractions

Matthew Wilson mwilson at sarcastic-horse.com
Fri Oct 10 11:37:47 EDT 2003


After writing out the problem, the solution became pretty obvious.  The
contents of the list don't matter at all.  It's all based on the number of
the elements.

>>> def g3(ll):
	x = len(ll)
	for i in range(0, x+1):
		xx = i/float(x)
        	yield xx









More information about the Python-list mailing list