Advertisement
Kosheen

Database Choice

Feb 8th, 2023
912
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. scheme = {1: ('Where to go', 2, 3), 2: ('Finish1',), 3: ('The end',)}
  2.  
  3. node = 1
  4. while (len(scheme[node]) == 3):
  5.   question, if_yes, if_no = scheme[node]
  6.   print(question)
  7.   answer = input()
  8.   node = if_yes if (answer == '1') else if_no
  9.    
  10. print(scheme[node])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement