Vidyalelo
Python · Q13

Python Built

Programming · Python · question 13

Q13

The function divmod(a,b), where both 'a' and 'b' are integers is evaluated as:

A.
(a%b, a//b)
B.
(a//b, a%b)
Answer
C.
(a//b, a*b)
D.
(a/b, a%b)

Answer: Option B

Solution

Answer: Option B
Solution:
The correct answer is Option B: (a//b, a%b).
The divmod() function in Python returns a tuple containing the quotient and remainder when dividing 'a' by 'b', where both 'a' and 'b' are integers.
So, when evaluated, it returns (a//b, a%b), where 'a//b' represents the quotient and 'a%b' represents the remainder.