Simple Calculator
imcraft (5)

Simple Calculator I made. Just select which math operation you want then type the two numbers you need!

You are viewing a single comment. View All
EthanCulp (14)

@ChezCoder Or simpler with less lines:

equation = (input('Enter first number\n> ') + input('Enter the operator\n> ') + input('Enter second number\n> '))
try:
print(eval(equation))
except:
print(equation, '- This is not a valid equation')

But without the try/except, it can be just one line:
`
print(eval((input('Enter first number\n> ') + input('Enter the operator\n> ') + input('Enter second number\n> ')))