Create a3.py

This commit is contained in:
Lukas Baumann 2021-02-17 10:24:29 +01:00 committed by GitHub
parent 392fed1267
commit 10874daa5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

8
15/a3.py Normal file
View File

@ -0,0 +1,8 @@
def execute(prog):
lines = set()
location = 0
while True:
lines.add(location)
if location==len(prog)-1: return "success"
location = findLine(prog, prog[location].split()[-1])
if location in lines: return "infinite loop"