Python 3 - BASIC Simulator
问题 I'm currently working on a BASIC simulator in Python, as the title suggests. This program should either print "success" or "infinite loop", depending on which one is true. Here is my code: def findLine(prog, target): for l in range(0, len(prog)): progX = prog[l].split() if progX[0] == target: return l def execute(prog): location = 0 while True: if location==len(prog)-1: return "success" else: return "infinite loop" T = prog.split()[location] location = findLine(prog, T) FindLine should take