So if I run:
a = b / c
and get the result 1.2234
1.2234
How do i separate it so that I have:
a = 1 b = 0.2234
>>> from math import modf >>> b,a = modf(1.2234) >>> print ('a = %f and b = %f'%(a,b)) a = 1.000000 and b = 0.223400 >>> b,a = modf(-1.2234) >>> print ('a = %f and b = %f'%(a,b)) a = -1.000000 and b = -0.223400
2.1m questions
2.1m answers
60 comments
57.0k users