Ask Question
21 February, 18:54

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)

+4
Answers (1)
  1. 21 February, 19:44
    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?
Get 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 & 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