While loops can be ran as long as the condition is True. Otherwise, it'll be skipped. A variable needs to be in it or else it'll loop forever in some scenarios. Here's an example of a while loop:
i = 1
while i < 6:
print(i)
i += 1
While loops can be ran as long as the condition is True. Otherwise, it'll be skipped. A variable needs to be in it or else it'll loop forever in some scenarios. Here's an example of a while loop:
i = 1
while i < 6:
print(i)
i += 1