Flow controls: Conditions · 8 / 22 Exercise Easy

Basic calculator using if

Objective

Write a Python program that functions as a basic calculator. The program will prompt the user to input two numbers and a mathematical operation (+, -, x, /). It will then perform the selected operation and display the result on the screen.

If the operation symbol is different from the allowed operators (+, -, x, /), the program will indicate "Character not recognized."

Input
4
x
4
Output
4 x 4 = 16

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise