On 12/08/2019 19:35, Alan Gauld via Tutor wrote:
> To save some typing convert the?? int conversion loop into a function:
>
>
> def?? to_ints(strings):
> ?????? num_copy = []
> ?????? for num in nums:
> ???????????????? num_copy.append(float(num))
>
> ?????? return num_copy
#
No idea where all the ? came from, however I made a bad error
in that code...
It should read:
def to_ints(strings):
num_copy = []
for num in strings: # strings not nums!
num_copy.append(float(num))
return num_copy
Apologies.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor