Ask 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 < 12: print (2) else: print (3)

+3
Answers (1)
  1. 15 February, 01:13
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers