0
Does python have do while loop ?
if not, how u can make it.when i search on Google it shows me 'a properly constructed while loop can do it ' . how to construct it ?
2 odpowiedzi
+ 16
By 'properly constructed', it means that your while loop condition permits the loop to run at least once. E.g.
bool loop_run = true;
while (loop_run)
{
// codes which evaluates and alter loop_run
}
0
There was a proposal to add a "do" header to a while loop to prepare for the while loop, not exactly like in other languages, but it was refused (see PEP 315 for the proposal)