0
Where we use 'while true' condition
While loop
3 Réponses
+ 3
Sometimes you don't want or can't define what will be the ending condition of the loop. So by using true, the loop goes on and on.
The point is to create an abort condition in the code block instead, using break.
For example (in Python since you seem to be studying that):
list_ = []
while True:
x = input()
if not x:
break
list_.append(x)
+ 1
Thanks
0
For making an infinite loop