dimanche 26 février 2017

How would I go about determining if an integer is a multiple of 2 but not a multiple of 3 print ‘

This is an example out put

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