Basics of Python,learning
Gabriel Genellina
gagsl-py2 at yahoo.com.ar
Sun Mar 16 19:44:17 EDT 2008
En Sun, 16 Mar 2008 14:25:26 -0200, Guido van Brakel
<guidovb1 at invalid.xs4all.nl> escribi�:
> Why is this not working,and how can I correct it?
I guess you want to:
a) read a single line containing many numbers separated by white space
b) convert them to a list of floating point numbers
c) print their minimum and maximum value
a) Already done
>> z = raw_input ('Give numbers')
b) Already done
>> y = z.split()
>> b=[]
>> for i in y:
>> b.append(float(i))
The list of numbers is called "b". Don't define a function with the same
name, you'll lose the original list attached to the name "b".
c) Almost done; remember that your list of numbers is called "b" not "a":
>> print min(b)
>> print max(b)
d) We (Python and me) have no idea what "gem" is:
>> print gem(b)
--
Gabriel Genellina
More information about the Python-list
mailing list