Giter Site home page Giter Site logo

python-calculator's Introduction

python-calculator

Basic calculator functions in python

Working in a conda environment

Make sure you have conda or miniconda installed.

Create conda environment

conda create --name python-calculator python=3.8

Activate conda environment

conda activate python-calculator

Install dependencies

python -m pip install -r requirements.txt

Install the package

Make sure you have activated your conda environment.

conda activate python-calculator

Then run:

pip install .

Running tests

Make sure you have activated your conda environment. Then run:

python -m pytest

python-calculator's People

Contributors

aplegit avatar salehpouresmaeeli avatar t-rooker avatar

Watchers

 avatar

python-calculator's Issues

[FEATURE] Add multiplication function

Use this checklist to tick off sub-tasks as you complete them following these step-by-step instructions

  • Create new multiply branch
  • Add multiply function
  • Import function in __init__.py
  • Add multiply test
  • Commit changes and push to GitHub
  • Make pull request
  • Close issue

Instructions

Create branch

Create a new multiply branch from main to work in.

Add multiplication function

Create a new multiply.py file in the pythoncalculator/ directory.

def multiply(x, y):
    return x + y

Open the pythoncalculator/__init__.py file and add the following line of code:

from .multiply import multiply 

Add multiplication test

Create a new test_multiply.py file in the tests/ directory.

Add the following code and save:

from pythoncalculator import multiply


def test_multiply():
    assert multiply(10, 3) == 30

Commit your changes and push to GitHub

Once you've created your function and test files and added the line to import your function to pythoncalculator/__init__.py, commit your changes.

Use resolves #{ISSUE_NUMBER_YOU_WERE_ASSIGNED} in your commit message to automatically close the issue when your pull request is merged.

Then push them up to GitHub

Create pull request

Finally, create a pull request back to the main branch on GitHub and wait for the owner's review.

Reference the issue your pull request refers to with #{ISSUE_NUMBER_YOU_WERE_ASSIGNED} in the description.

Respond to any requests for correction.

Close issue

If the issue didn't close automatically, close it yourself. You can also

[FEATURE] Add subtraction function

Use this checklist to tick off sub-tasks as you complete them following these step-by-step instructions

  • Create new subtract branch
  • Add subtract function
  • Import function in __init__.py
  • Add subtract test
  • Commit changes and push to GitHub
  • Make pull request
  • Close issue

Instructions

Create branch

Create a new subtract branch from main to work in.

Add subtraction function

Create a new subtract.py file in the pythoncalculator/ directory.

def subtract(x, y)
    return x - y

Open the pythoncalculator/__init__.py file and add the following line of code:

from .subtract import subtract 

Add subtraction test

Create a new test_subtract.py file in the tests/ directory.

Add the following code and save:

from pythoncalculator import subtract


def test_subtract():
    assert subtract(1, 3) == -2

Commit your changes and push to GitHub

Once you've created your function and test files and added the line to import your function to pythoncalculator/__init__.py, commit your changes.

Use resolves #{ISSUE_NUMBER_YOU_WERE_ASSIGNED} in your commit message to automatically close the issue when your pull request is merged.

Then push them up to GitHub

Create pull request

Finally, create a pull request back to the main branch on GitHub and wait for the owner's review.

Reference the issue your pull request refers to with #{ISSUE_NUMBER_YOU_WERE_ASSIGNED} in the description.

Respond to any requests for correction.

Close issue

If the issue didn't close automatically, close it yourself. You can also

[FEATURE] Add division function

Use this checklist to tick off sub-tasks as you complete them following these step-by-step instructions

  • Create new divide branch
  • Add divide function
  • Import function in __init__.py
  • Add divide test
  • Commit changes and push to GitHub
  • Make pull request
  • Close issue

Instructions

Create branch

Create a new divide branch from main to work in.

Add division function

Create a new divide.py file in the pythoncalculator/ directory.

def divide(x, z):
    return x / y

Open the pythoncalculator/__init__.py file and add the following line of code:

from .divide import divide 

Add division test

Create a new test_divide.py file in the tests/ directory.

Add the following code and save:

from pythoncalculator import divide


def test_divide():
    assert divide(10, 2) == 5

Commit your changes and push to GitHub

Once you've created your function and test files and added the line to import your function to pythoncalculator/__init__.py, commit your changes.

Use resolves #{ISSUE_NUMBER_YOU_WERE_ASSIGNED} in your commit message to automatically close the issue when your pull request is merged.

Then push them up to GitHub

Create pull request

Finally, create a pull request back to the main branch on GitHub and wait for the owner's review.

Reference the issue your pull request refers to with #{ISSUE_NUMBER_YOU_WERE_ASSIGNED} in the description.

Respond to any requests for correction.

Close issue

If the issue didn't close automatically, close it yourself. You can also

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.