10.5k views
23 votes
What is the output of this program?

numA = 2
numB = 3
if numA == 2 or numB == 2:
print("yes")
elif numA == 2 and numB == 3:
print("no")
Output:

User Mmell
by
4.2k points

1 Answer

7 votes

Answer:

Output: yes

Step-by-step explanation:

First if statement is satisfied, since numA==2, so yes is printed.

The elif statement is skipped altogether, since elif statements are only evaluated, when the statement above if false, which it is not.

User Jocel
by
4.7k points