Created
November 13, 2018 21:08
-
-
Save peroh215/eb7aaea13b461aa7987d0eebae0aa489 to your computer and use it in GitHub Desktop.
Shortest calculator possible in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
try: | |
usr = input('Enter operation: ') | |
pu = int(eval(usr)) | |
print(pu) | |
except NameError as ne: | |
print('You need to enter a mathematical operation') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment