I tried it with if not in and if != but both just won't work. I want it to print Error(...) if the input is not a number but now it always prints the error. Below is my code:
from time import sleep
symbol = input("Do you want to calculate with +, -, * or /? Answer: ")
if symbol not in {"+", "-", "*", "/"}:
print("Error 400. Bad Request.")
sleep(2)
exit()
number1 = input("What " + symbol + " what do you want to calculate? (Only one Number) Answer: ")
if number1 != int:
print("Error 400. Bad Request.")
sleep(2)
exit()
number2 = input("What " + symbol + " what do you want to calculate? (Only one Number) Answer: ")
if number2 != int:
print("Error 400. Bad Request.")
sleep(2)
exit()
if symbol in {"+", "-", "*", "/"}:
print(number1 + symbol + number2)