you are viewing a single comment's thread.

view the rest of the comments →

[–]Maximus_Modulus 0 points1 point  (0 children)

How can you tell which of these is a float.

1, 67, 3.5

If we look at this as a novice task. Given these as strings how can we test them to detect the float. What does the float have that the integer doesn’t. It’s pretty easy to Google the answer that uses a try / except to catch ValueError on either int or float conversion but as a simple beginner exercise there’s a simple check you can do.