So is the while loop beyond the scope of the original value of location?
prog- is a list of strings.
The print statement is just for me trying to debug.
The if statement looks for a condition to end the loop.
- Code: Select all
# here is a broken solution to get you started
location = 0
location = findLine(prog, T)
Traceback (most recent call last):
In line 8 of the code you submitted:
TypeError: list indices must be integers, not NoneType
As a small aside, it looks as if the original definition of location is used as a way to refer to list index 0, but then the value of location is updated by location=findLine(prog,T). Which to me, seems to make the use of location as a counter pointless in the way it's used.
Any help or discussion about this will be great. Many thanks.