reverseNotations = { "R": "L'", "R'": "L", "R2": "L2", "r": "l'", "r'": "l", "r2": "l2", "L": "R'", "L'": "R", "L2": "R2", "l": "r'", "l'": "r", "l2": "r2", "U": "U'", "U'": "U", "U2": "U2", "u": "u'", "u'": "u", "u2": "u2", "F": "F'", "F'": "F", "F2": "F2", "f": "f'", "f'": "f", "f2": "f2", "B": "B'", "B'": "B", "B2": "B2", "b": "b'", "b'": "b", "b2": "b2", "D": "D'", "D'": "D", "D2": "D2", "d": "d'", "d'": "d", "d2": "d2" } notation = " " inNotations = [] while notation != "": notation = input("Enter first letter of alg: ") if notation != "": inNotations.append(notation) if notation in reverseNotations: print(inNotations)