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,284 Freecoin
P
Peterparker87
1,849 Freecoin
J
Johnhendrick
1,551 Freecoin
G
GwenJasmine
856 Freecoin
M
mahlibeardman
759 Freecoin
S
Smith16
738 Freecoin
S
speechhub
722 Freecoin
A
Alfrenoe87
618 Freecoin
Davy200
Davy200
590 Freecoin
peterkester96
peterkester96
517 Freecoin
Top