while True: try: opr = input("calculator> ") exec(f'ans = {opr}') print(ans) except KeyboardInterrupt: print() quit()