Can anyone explain this behaviour?

Margarida Conde mconde at netc.pt
Sat Aug 17 00:25:37 CEST 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