+ 5

Can you please explain the output of this code?

my_variable = pow(2,2,3) print(my_variable)

3rd Mar 2020, 12:03 PM
APC (Inactive for a while)
APC (Inactive for a while) - avatar
2 Answers
+ 2
pow(x, y, z) returns x**y%z
3rd Mar 2020, 12:09 PM
Aymen
+ 1
so my_variable==2**2%3==4%3==1
3rd Mar 2020, 12:09 PM
Aymen