Question 12 Modulo


#1


Lesson 1 Question 12 Modulo


Oops, try again. It looks like spam is 7 instead of 1.
I am fairly sure 9 will not go into 16, 7 times.


I expected a spam = 1 but got spam = 7


#Set spam equal to 1 using modulo on line 3!

spam = 16 % 9

print spam


#2

how is the remainder of 16 % 9?

16 - 9 = 7
7 -9 = can't

so the remainder is 7, while it should be 1


#3

I've never fully understood this myself. I thought that taking the modulo of something meant dividing two numbers and then returning the remainder?

If you wouldn't mind, could you please give some insight on this topic? Thank you.


#4

it returns indeed the remainder, the leftover. if you have:

18 % 7 = 4

the biggest number inside 18 which you can divide by 7 is 14. So the remainder is 4 (18-14)


#5

Alright, that makes sense, thank you.


#6

I'don't know what your talking about.


#8

helppppppppppppppppppp


#9

If you need help please create a new topic with your code + error message + question