Python में pow(2, 3, 5) का परिणाम क्या होगा?
What will be the result of pow(2, 3, 5) in Python?
A
1
B
2
C
3
D
8
Explanation
The
pow() function in Python, when provided with three arguments, calculates (base ** exponent) % modulus.
In the given expression
pow(2, 3, 5):
baseis 2exponentis 3modulusis 5
First,
Then,
2 ** 3 is calculated, which equals 8.Then,
8 % 5 is calculated, which is the remainder when 8 is divided by 5. This remainder is 3.
Therefore, the result of
pow(2, 3, 5) in Python is 3.
The correct answer is (c) 3.
Correct Answer: C) 3