[Tutor] Me again
jason hochstein
bigapple631 at optonline.net
Thu Aug 12 00:54:33 CEST 2004
This is what I get when using the %.
l_input=[]
while True:
s = raw_input("Type number. Hit enter for more or type quit to finish: ")
if s == "quit":
break
else:
l_input.append(float(s))
for i in l_input:
average = sum(l_input) / len(l_input)
middle = len(l_input) % 2
print "The mean of this list is ",average
print "The median of this list is",middle
Here is what I get:
>> The mean of this list is 5.5
The median of this list is 0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20040811/7a4040e9/attachment.html
More information about the Tutor
mailing list