Skip to content

Commit

Permalink
Changed argument type back to int and fixed modulus algorithm for neg…
Browse files Browse the repository at this point in the history
…atives
  • Loading branch information
ghemsley committed Oct 10, 2017
1 parent ea33467 commit 2e60a1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def factor(__n):
__factorList = []

if __n > 0 or __n < 0:
for __i in range(1,abs(int(__n)+1)):
for __i in range(1, abs(int(__n))+1):
if __n % __i == 0:
__factorList.append(__i)
elif __n == 0:
Expand All @@ -21,7 +21,7 @@ def main():
__args = None

__parser = argparse.ArgumentParser()
__parser.add_argument("number", help="Number to factor", type=float)
__parser.add_argument("number", help="Number to factor", type=int)
__args = __parser.parse_args()
print(str(factor(__args.number)))
exit()
Expand Down

0 comments on commit 2e60a1f

Please sign in to comment.