I am able to get the code work good when the compound statement is changed to
if a % 2 == 0
and b % 2 == 0
:
But as I am in learning phase could someone please guide me in explaining the error in the original code.
exm_list = [(4,8),(1,2),(4,5),(6,7),(10,20),(3,5),(3,2)]
for a,b in exm_list:
if a and b % 2 == 0:
print(f'{a,b} are the even numbers')
else:
print(f'one of {a,b} is the odd number')