πŸ“Š Python
Q. What is the output of the following code?
Code:
x = True
y = False
z = False
  
if not x or y: 
    print 10
elif not x or not y and z: 
    print 20
elif not x or y or not y and z: 
    print 30
else: 
    print 40
  • (A) 10
  • (B) 20
  • (C) 30
  • (D) 40
πŸ’¬ Discuss
βœ… Correct Answer: (D) 40

Explanation: In Python, the order of priority is first NOT, then AND and finally OR.

Explanation by: Tanmay
In Python, the order of priority is first NOT, then AND and finally OR.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
190
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Tanmay
Publisher
πŸ“ˆ
91%
Success Rate