Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed mod function #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions calc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ def div(a, b):
def mul(a, b):
return b

def mod(a, b):
res = a % b
return -1
def mod(a, b)
"""Return the mod of 2 integers"""
return a % b

def pow(a, b):
"""
Expand Down
5 changes: 4 additions & 1 deletion calc/tests/test_calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ def test_pow():
assert pow(2,2) == 4
assert pow(10,0) == 1
assert pow(0.5,2) == 0.25
assert pow(4,0.5) == 2
assert pow(4,0.5) == 2

def test_mod():
assert mod(5,2) == 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect indentation.

Please ensure editor is set to indent with 4 spaces.