splitting a number into the integer and decimal parts
Use math.modf
:
import math
x = 1234.5678
math.modf(x) # (0.5678000000000338, 1234.0)
We can use a not famous built-in function; divmod:
>>> s = 1234.5678
>>> i, d = divmod(s, 1)
>>> i
1234.0
>>> d
0.5678000000000338