Alan Gauld <alan.gauld <at> freenet.co.uk> writes:

> > With other words I'd like to tell Python: Convert into a float if 
> > possible, otherwise append anyway. 
> 
> [ (type(x) == type(5) and float(x) or x) for x in mylist ]

Almost fell for it too, but the original list contains numbers 
stored as strings :).

Andrei


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to