So, I'm trying to make a very simple calculator, (one of my first "projects"). In this calculator you must choose an operation. Since each operation has an associated number, and I use if and elif to make the choice of operation. However when choosing the operation using input, at the time of application check the values chosen, says that the variable in this case y has not been defined. Edit: The problem has been solved but now it has learned another one in which after choosing the numbers The program does not make the accounts and simply finishes.
y = input('.:')
n1 = float(input("Primeiro Número "))
n2 = float(input("Segundo Número "))
if y == 1:
print(n1, "+" ,n2, "=" (n1+n2))
if y == 2:
print(n1, "-" ,n2, "=" (n1-n2))
elif y == 3:
print(n1, "x" ,n2, "=" (n1*n2))
if Y == 4:
print(n1, "/" ,n2, "=" (n1/n2))
calc()