Python Programming - Loops - Discussion

Discussion Forum : Loops - General Questions (Q.No. 30)
30.
Which of the following is the correct syntax for a do-while loop?
do { } while condition;
while condition: { }
do: 
 code 
while condition
while True: 
    code 
    if not condition: break
Answer: Option
Explanation:
Python does not have a built-in do-while loop, but it can be simulated using a while loop with a break statement to exit the loop based on a condition.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.