Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Casting float value to an integer in Python

pi = 3.14  # float number
print(type(pi))
# Output class 'float'

# converting float integer
num = int(pi)
print("Integer number:", num)
# Output  3
print(type(num))
# Output class 'int'
Source by pynative.com #
 
PREVIOUS NEXT
Tagged: #Casting #float #integer #Python
ADD COMMENT
Topic
Name
4+8 =