0
Numeric operation
Can we determine the quotient and remainder of an integer and float
2 ответов
+ 4
you can use divmod(). it gives you both: quotient and remainder.
see sample:
print(divmod(10, 3.0))
# output: (3.0, 1.0)
res = divmod(10, 3.0) # creates a tuple with both valus
x, y = divmod(10, 3.0) # x and y are each holding one of the values
+ 2
Yes, just try it in the playground