Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scheme = {1: ('Where to go', 2, 3), 2: ('Finish1',), 3: ('The end',)}
- node = 1
- while (len(scheme[node]) == 3):
- question, if_yes, if_no = scheme[node]
- print(question)
- answer = input()
- node = if_yes if (answer == '1') else if_no
- print(scheme[node])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement