What about doing
your_number%2 == 0 and your_number%3 != 0
Where %
is the modulus operator and divides left hand operand by right hand operand and returns the remainder. So if the remainder is equal to 0
, the left operand is a multiple of the right operand.
Thus
your_number%2 == 0
returns True
if your_number
is a multiple of 2
and
your_number%3 != 0
returns True
if your_number
is not a multiple of 3.
To provide you with a full answer, what you need is:
if myint%2 == 0 and myintr%3 != 0:
print(str(myint), "is a multiple of 2 and not a multiple of 3")