Q. What is the output of the following code?

Code:
i = 1
while False:
    if i%2 == 0:
        break
    print(i)
    i += 2
  • (A) 1
  • (B) 1 3 5 7 …
  • (C) 2 4 6 8 …
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) None of the above
Explanation: The control does not go into the loop because of “False”.
Explanation by: Rajeev Malhotra
The control does not go into the loop because of “False”.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
232
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Rajeev Malhotra
Publisher
πŸ“ˆ
89%
Success Rate