Ask Question
16 June, 21:48

What's the output of this code if number equals 10? if number > 11: print (0) elif number! = 10: print (1) elif number > = 20 or number < 12: print (2) else: print (3)

+5
Answers (1)
  1. 16 June, 23:57
    0
    2

    Explanation:

    We start with the number=10.

    If condition: number>11

    But since number=10 we will not process "print (0) " and move to the else-if statement

    elif number! = 10

    But since number=10 we will not process "print (1) " and move to the next else-if statement

    elif number > = 20 or number < 12

    since number=10 we will process "print (2) " as 10 = 20 is not satisfied because of the or statement we will still process "print (2) " as 10<12 is satisfied.

    Hence the output is 2
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “What's the output of this code if number equals 10? if number > 11: print (0) elif number! = 10: print (1) elif number > = 20 or number < ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers