Why [if number % 3 == 0]?


#1



https://www.codecademy.com/courses/python-beginner-c7VZg/1/5?curriculum_id=4f89dab3d788890003000096#


I can´t understand this line of code in this exercice:

---- if number % 3 == 0 why we use % here?


Replace this line with your code.


#2

its the modulo operator, it calculates the remainder. If the remainder is zero, the number (in this case 3) is divisible by 3


#3

thanks for the explanation!


#4