Wat is the use of while : True ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Wat is the use of while : True ?

13th Aug 2016, 12:58 PM
Harish Krishna
Harish Krishna  - avatar
5 Answers
+ 2
it's like while (1) in c
13th Aug 2016, 7:03 PM
Jayvardhan Deshmukh
Jayvardhan Deshmukh - avatar
+ 2
Practically it is to execute a block of code continuously for some reason. it's always useful for non gui programs to get a specific user input
14th Aug 2016, 4:13 AM
sundar
sundar - avatar
+ 2
used for infinite looping.
15th Aug 2016, 9:43 AM
Bharati Deepak Giri
+ 1
like an infinite loop. but you can terminate the looping by break statement
13th Aug 2016, 1:23 PM
Gilli Vimalraj
Gilli Vimalraj - avatar
+ 1
If you put in while 1==1: print ("anything you want") it will make an infinite loop like this 1 1 1 1 1 1 1 1 1 1 1 1 . . .
15th Aug 2016, 12:40 PM
GGlel