What is the output of print(pow(6, 2, 10)) in Python?
print(pow(6, 2, 10))
Correct answer
D. 6
5 views
D. 6
5 views
pow(base, exp, mod) computes (base ** exp) % mod efficiently: 6 ** 2 is 36 and 36 % 10 is 6.
Asked in: Python Interview Advanced
https://docs.python.org/3/library/index.htmlNot sure why the answer is D? Ask here and get an explanation.