What does while true does? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What does while true does?

2nd Nov 2016, 9:07 AM
Mala Pokharel
Mala Pokharel - avatar
2 Answers
+ 3
It continued to loop through inside code as long as condition remains true
2nd Nov 2016, 9:09 AM
Waqas Asghar Bhalli
Waqas Asghar Bhalli - avatar
+ 1
________________ I=0. | while i<=3: | i+=1. | ________________| this concept works on boolean means a thing will executed until something is "True" means in first condition i=0 then i=2 then i=3 every condition will be checked in the last case when it will check the condition it will return True and the loop will broke but when if you will do this while True: #code means the condition will go on untill broken by a break statement like this while True: #code will stop instantly break
2nd Nov 2016, 4:07 PM
Anas Aijaz
Anas Aijaz - avatar