a = 10 b = 10 if a == 10 and (b != (not(10))) and b == 10: print("Yes") # In the first if else. This print Yes. If it is true then else: print("No") if a == 10 and (b != (not(11))) and b == a: print("Yes1") # At second if else. This should be print No. Over to you else: print("No2")