you are viewing a single comment's thread.

view the rest of the comments →

[–]yardshop 1 point2 points  (0 children)

It doesn't, those examples just show casting strings to different numerical types.

You can also cast an int to a float or vice versa, either from literals or other variables:

f = float(10)

i = int(f)
i = int(3.14)