Returns the quotient and remainder as a tuple.
Syntax
divmod(a, b)Example
Enter values below to update the example in real time.
print→divmod→print(divmod(10, 3)) # (3, 1)
print(divmod(7, 2)) # (3, 1)
q, r = divmod(17, 5)
print(f"몫: {q}, 나머지: {r}") # 몫: 3, 나머지: 2