+ 2
Help
How do I know when to use do...whiles vs using a while loop?
4 Answers
+ 7
Python does not have a do .. while. It just has a while.
+ 1
do...while is just like a while loop, both run until the the condition mets false
Only difference: do...while allows to run once even if the condition is false whereas while loop doesn't
+ 1
You can effectively get a do-while in python by using:
while True:
...
code here
...
if someCondtionIsTrue:
break
0
the difference is that you use "do while" if want the code to run one time at least Even if the condition is not met .