Answers for "divmod python"

4

python divmod

a = 6
b = 4

# a // b = 1
# a % b = 2

print(divmod(a,b))
>> (1, 2) # tuple
print(*divmod(a,b))
>> "1 2"
Posted by: Guest on December-31-2020
0

divmod

div, remainder = divmod(numerator, denominator)
Posted by: Guest on September-17-2020

Python Answers by Framework

Browse Popular Code Answers by Language