Hey guys! I need help with python programming. I don’t know how to create an input system that allows the user to decide which operation(like multiplication, division, addition) to use. And the program has to run continuously and the user types exit 
For this part, you could use the if-else code, like this:
operation = input()
if operation == “add”:
print(1+1)
For this you could use a while loop, and use the “break” command when the user types exit. And put the if-else inside the loop. Like this:
operation = “”
while operation != “exit”:
operation = input()
if operation == “add”:
print(1+1)
elif operation == “subtract”:
print(4-2)
elif operation == “multiply”:
print(5*2)
elif operation == “divide”:
print(10/5)
elif operation == “exit”:
break
^ So the whole thing could look something like that. I don’t know if this helped or not ![]()
![]()
![]()
You didn’t return nothing in the function, therefore, when you try to print (for example: print(multiply(num1,num2)) it prints the address instead of the actual value, you should return something from the function or just call it without using print
Wait so, what am I suppose to return then?
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

