A simple Python calculator that takes two numbers and an operator (+, -, *, /) from the user, performs the operation, and displays the result. Created as part of the Intro to Python assignment for PLP Africa.
- Accepts user input for numbers and operator
- Supports basic operations: addition, subtraction, multiplication, and division
- Handles division by zero errors
- Simple and beginner-friendly
Enter the first number: 10 Enter the second number: 5 Enter the operation (+, -, *, /): + 10.0 + 5.0 = 15.0
- How to collect input from users in Python
- Using
if,elif, andelsestatements for logic - Displaying results using
print()and formatted strings
calculator.py— The main Python script
This project was completed as part of the "Intro to Python" module for the PLP Africa program.