Created
February 7, 2017 23:49
-
-
Save jeacom25b/ea120fc6dd6d2d765aba586c5b33660d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#infinite for loop | |
b = [1,2] | |
for i in range(len("loops")): | |
for a in b: | |
b.append(a) | |
print (a) | |
c = [1,2] * 5 | |
#never reaches# | |
print (b, c) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You add new a in b
So each time there's one more value to process in the for loop
So yeah rip your infinite loop