{}
See how a CS professor is using our compiler for class assignment.
Try Programiz PRO for Educators!
Learn DSA with step-by-step code visualization.
Try Programiz PRO for Educators!
run-icon
main.py
Prompt = """Select an operation to perform: 1 - ADD 2 - SUBTRACT 3 - MULTIPLY 4 - DIVIDE # """ User_Input = input(Prompt) A = int(input("Enter first number: ")) B = int(input("Enter second number: ")) if User_Input == "1": C = A + B elif User_Input == "2": C = A - B elif User_Input == "3": C = A * B elif User_Input == "4" and B != 0: C = A / B else: C = None print("Incorrect Input!") print("Result:", C)
Output