Thursday 6 May 2021

How to emulate a do-while loop?

 Here's a very simple way to emulate a do-while loop:

condition = True
while condition:
    # loop body here
    condition = test_loop_condition()
# end of loop


from : https://stackoverflow.com/questions/743164/how-to-emulate-a-do-while-loop

No comments:

Post a Comment