0
Just did the Basic module quiz - Why is the answer what it is? please help, logically does not make sense at the moment!
What is the output of this code? >>> x = 3 >>> num = 17 >>> print(num % x)
4 Respuestas
+ 5
that is not the divide operator
it is the modulo operator
it returns the remainder from the division 17/3
just look at the closest number which is divisable by 3, that is 15 as 15/5=3
and the difference from 15 to 17 is 2
+ 4
17=15+2=(3+3+3+3+3)+2
+ 1
Thanks for answering and forgive my stupidity but still don't get it.
if X = 3 and num = 17 and the % means to divide, then why 2.
like i said why is the answer the answer?
+ 1
Thanks Burey, got it