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

Watchers

Forks

Releases

No releases published

Packages

No packages published