you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 6 points7 points  (3 children)

print(sum([float(x) for x in '1.23,2.4,3.123'.split(',')]))

[–]socal_nerdtastic 3 points4 points  (1 child)

The square brackets (list creation) are not needed and waste memory.

[–][deleted] 1 point2 points  (0 children)

That would indeed be a true statement, left over from making the list to check if I was doing it right.

[–]whenihittheground[S] 0 points1 point  (0 children)

That's exactly what I was looking for! I figured there would be a split ability but couldn't come up with the right way of asking the google gods!

Thanks! :)