mercredi 4 octobre 2017

Testing the remainder from a modulo operation using conditionals

Takes in a number and indicates if its remainder when divided by 3 is 0, 1, or 2.

My code:

number = int(input("Please enter the number"))
print(number % 3)

How do I test the result of the modulo to determine whether the number is divisible by 3 or not?

Aucun commentaire:

Enregistrer un commentaire