Skip to content

codingUnited/Challenege-EricaBoterf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

🧮 Challenge 2: Terminal Calculator

This is a fully-featured Python calculator built for the CodingUnited Challenge 2. It runs in the terminal and supports full math expressions, scientific notation, advanced math functions, and even fun Easter egg commands!


🚀 Features

✅ Core Functionality

  • Supports full expressions (e.g., 3 + 4 * 2, (5 + 2) * 3)
  • Handles order of operations, parentheses, exponents (^ or **)
  • Uses built-in math functions: sqrt(), sin(), cos(), tan()
  • Constants like pi, e
  • Scientific notation (1e-3 + 2.5e2)
  • Use ans to reference the previous result

✅ Commands

Command Description
help Show command and usage instructions
clear Clear memory and history
history Show past calculations
exit Exit the calculator

✅ Fun Commands 🎲

Command Result
flip a coin 🪙 Heads or Tails
roll a die 🎲 Random number 1–6
magic 8-ball 🎱 Random yes/no style answer

🎨 User Experience

  • Clean prompts and user-friendly messages
  • Colored output using colorama
  • Rounded results (4 decimal places)
  • Saves full history to calc_history.txt with timestamps

📁 Files

File Purpose
calculator.py Main calculator script
calc_history.txt Auto-generated log of sessions
README.md Project overview and instructions

🧪 Run Instructions

Requirements

  • Python 3.x
  • colorama library (install with pip install colorama)

How to Run

python calculator.py

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors