A small interactive Python calculator that asks for two numbers and an operation and prints the result.
- Supports addition (+), subtraction (-), multiplication (*), division (/), and power (^).
- Handles invalid input and division-by-zero gracefully.
- Interactive; type
qat any prompt to quit.
calculator.py— the interactive program.
- Make sure you have Python 3 installed.
- From the project directory run:
python3 calculator.py- Create a new repository on GitHub (via the website).
- On your machine, open a terminal and run:
git init
git add calculator.py README.md
git commit -m "Add simple calculator program"
git branch -M main
git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git
git push -u origin mainReplace YOUR_USERNAME and YOUR_REPO_NAME with your GitHub username and repo name. Git may ask for credentials or open a browser to authenticate (or use a personal access token).
Alternatively, you can upload the files using GitHub's web UI (Add file → Upload files).
This project is released under the MIT License. Use it freely.