BEGIN_PROGRAM = { 1 :lambda: goto(2) if response == "yes" else goto(3) if response == "no" else goto 100, 2 :lambda: print("Thanks for the yes!") or goto(20), 3 :lambda: print("Thanks for the no!") or goto(20), 20 :lambda: end(), 100 :lambda: print("You're annoying me - answer the question!") or goto(1) } # pay no attention to the code below the curtain def goto(linenum): global line line = linenum def end(): goto(0) line = 1 while line: BEGIN_PROGRAM[line]()