We can alternatively use control statements like break (to break out of the loop), and continue (to go to the next iteration of the loop):
print("TOP")counter =0whileTrue: # RETURN OF THE INFINITE LOOPprint("-------")print(counter, "Hello") counter +=1# INCREMENT THE COUNTERif counter >=5:break# BUT WHEN THIS CONDITION IS REACHED WE STOP# NOTHING ELSE, START THE LOOP OVERprint("BOTTOM")