if reply in ['a', 'b', 'c', 'd']: reply = {'a': 1, 'b': 2, 'c': 3, 'd': 4}[reply] else: reply = int(reply) # Convert numeric input to integer