how to truncate in pyhon 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: truncate toward zero python
>>> int(float(-1)/2)
0
>>> int(float(-3)/2)
-1
>>> int(float(1)/2)
0
>>> int(float(3)/2)
1