πŸ“Š Python
Q. What is the output of the following code?
Code:
try: 
   list = 2*[0]+2*[5] 
   x = list[2] 
   print('OK!') 
except IndexError: 
   print('Block Except!') 
else: 
   print('Block Else!') 
finally: 
   print('Block Finally!')
  • (A) OK!
  • (B) Block Else!
  • (C) Block Finally!
  • (D) All the answers are true
πŸ’¬ Discuss
βœ… Correct Answer: (D) All the answers are true

Explanation: Output:

OK!
Block Else!
Block Finally!

Explanation by: Tanmay
Output:

OK!
Block Else!
Block Finally!

πŸ’¬ Discussion


πŸ“Š Question Analytics

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