Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Match Case Calculator 🧮

A simple calculator built using Python's match-case statement introduced in Python 3.10.

This calculator performs basic arithmetic operations using a command-line interface and demonstrates the use of structural pattern matching in Python.

Features

  • Addition
  • Subtraction
  • Multiplication
  • Division
  • User-friendly terminal interaction
  • Built using Python match-case

Technologies Used

  • Python 3.10+

Example

match operator:
    case '+':
        print(a + b)

    case '-':
        print(a - b)

    case '*':
        print(a * b)

    case '/':
        print(a / b)

How to Run

Clone the repository:

git clone https://github.com/your-username/match-case-calculator.git

Move into the project folder:

cd match-case-calculator

Run the program:

python calculator.py

Learning Objectives

This project was created to practice:

  • Python basics
  • Structural pattern matching
  • Conditional execution
  • User input handling
  • CLI application development

Author

Utsab

About

Simple calculator code

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages