Exercise: Calculator
Create a script called basic2_calculator_input.py that accepts 2 numbers and an operator (+, -, *, /)
, and prints the result of the operation.
python calc.py
Operand: 19
Operand: 23
Operator: +
Results: 42
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
Create a script called basic2_calculator_input.py that accepts 2 numbers and an operator (+, -, *, /)
, and prints the result of the operation.
python calc.py
Operand: 19
Operand: 23
Operator: +
Results: 42