I tried to modify a list without using the range function. The error message says: "The program took too long to finish. Check your code for infinite loops and try again."
I wrote the following code. Why is this an infinte loop?
p = [1, 2, 3] for a in p: b = a * 2 p.insert(p.index(a), b) print p