This looks really good, but to make it a lot simpler, you could do this:

equation = input('Enter an equation you would like to answered\n> ') print('\nAnswer:') try: exec(f"print({equation})") except: print('[ERROR] Invalid Equation')

With this, it enters the 'print({equation})' into the terminal and then it returns the equation. If it is not an actual equation, it prints the error. Not trying to shoot you down and tell you your project is bad, it is actually pretty good, the code is clean and I probably wouldn't have thought to do it the way you did

equation = input('Enter the first number: ')
equation += input('Enter the operator: ')
equation += input('Enter the second number: ')
try:
print(
"Result: " + eval(equation) + "."
)
except:
print(equation + '? Really? Does that look like an equation to you?')

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> ')))

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

This looks really good, but to make it a lot simpler, you could do this:

equation = input('Enter an equation you would like to answered\n> ')

print('\nAnswer:')

try:

exec(f"print({equation})")

except:

print('[ERROR] Invalid Equation')

With this, it enters the 'print({equation})' into the terminal and then it returns the equation. If it is not an actual equation, it prints the error. Not trying to shoot you down and tell you your project is bad, it is actually pretty good, the code is clean and I probably wouldn't have thought to do it the way you did

@EthanCulp Thanks for the suggestion! That is a pretty good idea. I just did it like this because it is pretty easy.

@EthanCulp or more simple:

@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> ')))