asked 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:

asked
User Mmell
by
8.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.

answered
User Jocel
by
8.7k points