calculator.py
Raw
while True:
try:
print(eval(input("calculator> ")))
except Exception as e:
print(e)
except KeyboardInterrupt:
print()
quit()
1 | while True: |
2 | try: |
3 | print(eval(input("calculator> "))) |
4 | except Exception as e: |
5 | print(e) |
6 | except KeyboardInterrupt: |
7 | print() |
8 | quit() |