You were pretty close! The & operator in python is not the same as 'and' in python. 'and' tests that both conditions are logically true, while '&' is a bitwise operator that can satisfy conditions of logical trues, falses, and integers because these can be combined in bitwise, when 'and' just delineates logic.
num_1=int(input('first number '))
num_2=int(input('second number '))
if num_1%2==0 and num_2%2==0:
print(num_1,'and',num_2,'are even')
elif num_1%2!=0 and num_2%2!=0:
print(num_1,'and',num_2,'are odd')
elif num_1%2!=0 and num_2%2==0:
print(num_1,'is odd and ',num_2,'is even')
elif num_1%2==0 and num_2%2!=0:
print(num_1,'is even',num_2,'is odd')
else:
print('invalid entry')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…