Last active
April 21, 2022 09:35
-
-
Save FONQRI/866439eb7af8640e4cd7 to your computer and use it in GitHub Desktop.
A python3 calculator in one line
This file contains hidden or 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
print(eval(input('Please enter your arithmetic expression :' ))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi
You should use python 3.x for this calculator to get the answer because in python 3.x our inputs are strings but in python 2.x our inputs aren't strings and we don't need to get an eval of that so our code will be like this in python 2.x
print(input('Please enter your arithmetic expression :' ))