New course! Every coder should learn Generative AI!
Try a free lesson0
What is the output of this code
>>>x =3 >>>num =17 >>>print (num%x )
2 Answers
+ 1
Hello! in which line of the program's code do you have problems? where you don't understand what's going on?
+ 1
This symbol "%" name is modulus
It gives reminder of a division
Like in your example
x=3
num=17
So,
num % x
=17 % 3
=2 (17÷3 is 5 and reminder is 2)