python how to cast float to int code example
Example 1: convert float to int python
# convert float to int
x=3.1415
y=int(x)
print(y) #outputs 3
Example 2: int type cast to float in python
x = int(1) # x will be 1
y = int(2.8) # y will be 2
z = int("3") # z will be 3