Here is the code. When I enter an even number (1st number) say 4 and odd number (2nd number) say 5 it prints '4 and 5 are even'
num_1=int(input('first number '))
num_2=int(input('second number '))
if num_1%2==0 & num_2%2==0:
print(num_1,'and',num_2,'are even')
elif num_1%2!=0 & num_2%2!=0:
print(num_1,'and',num_2,'are odd')
elif num_1%2!=0 & num_2%2==0:
print(num_1,'is odd and ',num_2,'is even')
elif num_1%2==0 & num_2%2!=0:
print(num_1,'is even',num_2,'is odd')
else:
print('invalid entry')
See Question&Answers more detail:os