Skip to content

meseretak/PLP-Python-Assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 

Repository files navigation

PLP Python Assignment – Basic Calculator Author: Meseret Akalu (Mesi) Project: PLP Python Basics Script: calculator.py Description This is a beginner-friendly Python calculator program that:

Prompts the user to input two numbers.

Asks for a basic math operation (+, -, *, /).

Performs the operation and displays the result in a readable format.

The program includes input validation and handles division by zero like a boss.

Features Addition

Subtraction

Multiplication

Division (with zero check!)

User-friendly prompts πŸ—£

Clean, readable output

πŸ”§ How to Run Make sure Python is installed (3.x recommended).

Save the script as calculator.py.

Open terminal or command prompt.

Run the script with:

bash Copy Edit python calculator.py πŸ“Έ Sample Output mathematica Copy Edit Enter the first number: 10 Enter an operation (+, -, *, /): * Enter the second number: 3 10.0 * 3.0 = 30.0 ⚠️ Error Handling If user tries to divide by zero, an error message will be shown.

If an invalid operation is entered, a warning is displayed.

πŸ” Future Upgrades (Ideas πŸ’‘) Add power (**) and modulo (%) support

GUI with Tkinter or PyQt

Logging results to a file

Loop until user chooses to exit

🏁 Final Note This is a foundational project submitted for the PLP Python Assignment. Simple logic, solid results. Just like we like it. 🐍πŸ’ͺ

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages