Program 101: Choosing Arithmetic Operations using Python This program display the result based on the user's choice operation. It will not automatically print the results of all four operations. * The program using if, elif and else statement. Code: # Choosing Arithmetic Operation using Python num1 = int(input("Enter First Number: ")) num2 = int(input("Enter Second Number: ")) opr = input("Choose which operation would you like to perform? (+,-,*,/): ") if opr == '+': print("\nAddition: " +str(num1)+ " + " +str(num2)+ " = " +str(num1+num2)) elif opr == '-': print("\nSubtraction: " +str(num1)+ " - " +str(num2)+ " = " +str(num1-num2)) elif opr == '*': print("\nMultiplication: " +str(num1)+ " * " +str(num2)+ " = " +str(num1*num2)) elif opr == '/': print("\nDivision: " +str(num1)+ " / " +str(num2)+ " = " +str(num1/num2)) else: print("\nInvalid Operator") Running Program: https://onlinegdb.com/JWdPMzFr_
3 comments
That's different code of programing?
yes, there are different programming languages. In my post Im using python (not the snake) ahaha xD
you have a talent in programming.Programming is must be accurate to run it.