Can anyone explain this behaviour?

Margarida Conde mconde at netc.pt
Fri Aug 16 18:25:37 EDT 2002


I was just starting to learn and use python when I've found this thing I 
can't understand. The code follows:

from string import *

def tolist(line):
	return(map(float, split(line)))

print(tolist('0.1'))
print(float('0.1'))

Why do I get different results instead of:
[0.1]
0.1
?




More information about the Python-list mailing list