import sys list1 = [] dic = { # 'reset': 'reset what', 'reset board': 'board fault', 'board add': 'where to add', 'board delete': 'no board at all', 'reboot backplane': 'impossible', 'backplane abort': 'install first' } while True: a = sys.stdin.readline().strip() ...