0

Repeat until

How do i put a repeat until in python

28th May 2025, 11:52 AM
Randul Sathsara
Randul Sathsara - avatar
4 Antworten
+ 5
for instance, by using a while-loop. if you need help with your code, show your code and describe what it is supposed to do.
28th May 2025, 11:57 AM
Lisa
Lisa - avatar
+ 3
Brian I always use this method to mimic a do...while loop in python while True: .... if <condition>: break
29th May 2025, 4:32 PM
Wong Hei Ming
Wong Hei Ming - avatar
+ 2
Unfortunately Python does not have do ... until <condition> Python has only a while loop so you have to restructure your logic to use a negative condition: while not <condition>: ... And you may need to manage somehow to ensure the condition allows the while loop to execute at least once.
29th May 2025, 12:18 AM
Brian
Brian - avatar