Python Casting
Python Casting
❮ PreviousNext ❯
x = int(1) # x will be 1
y = int(2.8) # y will be 2
z = int("3") # z will be 3
Try it Yourself »
Example
Floats:
Try it Yourself »
Example
Strings:
Exercise?
What will be the result of the following code:
print(int(35.88))
35
35.88
36