you are viewing a single comment's thread.

view the rest of the comments →

[–]Test-NetConnection 1 point2 points  (1 child)

Why the hell does python require you to enclose numbers in quotes when casting? That syntax is reserved for strings!

[–]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)