What is the output of this Python code

Tekera

Tekera

New member
Freecoin
269
Hello everyone, I'm Starting to learn Python with sololearn. One of the quiz questions threw me, it's what is the output of this code?
x=3
num=17
print(num%x)

the answer appears to be 2 but I'm not sure why, can someone please explain lol 🤨
 

Richest Freecoded User

Most Freecoin

freecoded
freecoded
5,282 Freecoin
P
Peterparker87
1,755 Freecoin
J
Johnhendrick
1,551 Freecoin
S
Smith16
738 Freecoin
M
mahlibeardman
674 Freecoin
A
Alfrenoe87
599 Freecoin
Davy200
Davy200
590 Freecoin
D
domnickfury
505 Freecoin
R
riyageorge0895
496 Freecoin
peterkester96
peterkester96
450 Freecoin
Top