How would I go about determining if an integer is a multiple of 2 but not a multiple of 3 print ‘ is a multiple of 2 only.’ ? Using python.
if myint % 2: print(str(myint), "is a multiple of 2 only")
How do I get it to output "but not a multiple of 3"
Aucun commentaire:
Enregistrer un commentaire