[Tutor] Why am I getting an infinite loop?
Sun, 27 Aug 2000 19:12:21 -0400
I'm working through an exercise in O'Reilly's "Learning Python".
Here's the code
i = 0
print 'length of list is', len(l)
while i < len(l):
if 2**d == l[i]:
print 'at index', i
i = i+1
print d, 'not found'
When I test it by running the script, I get an infinite loop at the print
statemnt. Any ideas why this is happening?
Thanks in advance.