Help I think it is a glitch | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Help I think it is a glitch

What is the output of this code? >>> x = 3 >>> num = 17 >>> print(num % x) I got:0.51 and it only let me put in one number so I rounded it to 1 and it's wrong! Can someone help me?

3rd Jan 2017, 7:06 PM
Roxie
5 Answers
+ 4
computers are never wrong, glitches are just mistakes by the programmers
3rd Jan 2017, 8:18 PM
Kamil
Kamil - avatar
+ 3
The output is 2. 3*5=15, so the rest is 2.
3rd Jan 2017, 7:08 PM
Nahuel
Nahuel - avatar
+ 3
% its not division, its the rest. for divide use this -> /
3rd Jan 2017, 7:16 PM
Nahuel
Nahuel - avatar
+ 1
How
3rd Jan 2017, 7:14 PM
Roxie
+ 1
Can you explain please
3rd Jan 2017, 7:15 PM
Roxie