# Another student in my class showed us this code

#### Q.Dingle

and everyone else started to mess around with it and they got it to run but I cant figure out why it wont print anything. this is my first semester and I'm new to this.

def main():

numOne = int(input("What is your first number"))
numTwo = int(input("input your second number"))

def performOperation(numOne, numTwo, operation):

if(operation == "+"):
result1 = int(numOne) + int(numTwo)
print(result1)
elif(operation == "-"):
result2 = int(numOne) - int(numTwo)
print(result2)
elif(operation == "*"):
result3 = int(numOne) * int(numTwo)
print(result3)
elif(operation == "/"):
result4 = int(numOne) / int(numTwo)
print(result4)
else:
print("YOU DID NOT PRINT A VALID OPERATION SYMBOL")

main()

#### Q.Dingle

i know the three variables uptop are unused thats what my IDE is telling me but ive tried making them global or using return and idk.... it runs though it asks me all the right questions just wont output the final answer ok im still fiddling with it
heres this :

def main():

numOne = int(input("What is your first number"))
numTwo = int(input("input your second number"))

def performOperation(numOne, numTwo, operation):

if(operation == "+"):
print(int(numOne) + int(numTwo))
elif(operation == "-"):
print(int(numOne) - int(numTwo))
elif(operation == "*"):
print(int(numOne) * int(numTwo))
elif(operation == "/"):
print(int(numOne) / int(numTwo))

else:
print("YOU DID NOT PRINT A VALID OPERATION SYMBOL")

main()

Last edited:
You're not calling the function after you get the user's input. After "operation =", call `performOperation(numOne, numTwo, operation)`.