Ask Question
28 May, 21:22

What is output?

x = 21

if (x > 21):

print (1)

elif (x < 21):

print (2)

else:

print (3)

+2
Answers (1)
  1. 28 May, 23:15
    0
    The output of the following code is 3.

    Explanation:

    In the following Python Programming Language, the output is 3 because the variable x is equal to 21, then the user check the condition is the variable x is greater than 21 then print it print 1, otherwise the user check that the variable x is less than 21 then print 2, otherwise it print 3. So, the variable x is not greater than 21 or not less than 21, it is equal to 21. That's why the code execute the else block and print 3.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “What is output? x = 21 if (x > 21): print (1) elif (x < 21): print (2) else: print (3) ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers