What is the output of this code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the output of this code

>>>x =3 >>>num =17 >>>print (num%x )

30th Mar 2020, 5:56 AM
Fabrice njodzeven
Fabrice njodzeven - avatar
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?
30th Mar 2020, 6:02 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 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)
30th Mar 2020, 6:11 AM
Farhan
Farhan - avatar