Nov-07-2019, 06:42 PM
(This post was last modified: Nov-07-2019, 06:43 PM by kozaizsvemira.)
I am not master at python, but following code works:
def add(a,b): return a+b def substract(a,b): return a-b def divide(a,b): return a/b def multiplication(a,b): return a*b def increase(a, b): return a ** b def multiple_choice(): print ("Enter first number!") a = float(input("First number = ")) b = float(input("Second Number = ")) print ("You entered:",a," and ",b) print("::Menu::") print("1 - Add") print("2 - Substract") print("3 - Multiply") print("4 - Divide") print("5 - Increase") print("6 - Exit") choice = str(input("What you want do to:?\n")) if choice == '1': print('Your solution is:', add(a, b)) elif choice == '2': print('Your solution is:', substract(a, b)) else: print('Please input 1 to 6') multiple_choice()If you want result without decimals instead of float use int. Just add elif choice == 3...etc.