Skip to content

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.

Notifications You must be signed in to change notification settings

AbbieCodes7/intro-to-python-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

intro-to-python-calculator

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.

Features

  • Accepts user input for numbers and operator
  • Supports basic operations: addition, subtraction, multiplication, and division
  • Handles division by zero errors
  • Simple and beginner-friendly

Example

Enter the first number: 10 Enter the second number: 5 Enter the operation (+, -, *, /): + 10.0 + 5.0 = 15.0

What I Learned

  • How to collect input from users in Python
  • Using if, elif, and else statements for logic
  • Displaying results using print() and formatted strings

File

  • calculator.py — The main Python script

Assignment

This project was completed as part of the "Intro to Python" module for the PLP Africa program.

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages