I know that
while True:
condition to break loop
will result in an infinite loop. But I want to do the same with a 'for' statement. Somebody please help me
Use infinite iterator like itertools.count, itertools.cycle, itertools.repeat which yield items infinitely:
for i in itertools.repeat(1):
# do something
I can't tell exactly how you want your items to repeat, you may just want the following.
while True:
for value in items:
# ...
if condition:
break
# ...
if condition:
break
forloop"?