how to truncate in python code example
Example 1: remove decimal python
# Truncates a double to an int
i = 10.0
k = int(i)
# i = 10.0
# k = 10
Example 2: python truncate
import math
print(math.trunc(4.95*5.1))
# 25
# Truncates a double to an int
i = 10.0
k = int(i)
# i = 10.0
# k = 10
import math
print(math.trunc(4.95*5.1))
# 25