Skip to content

Commit

Permalink
made changes to the code by adding headings to the steps
Browse files Browse the repository at this point in the history
  • Loading branch information
SEMIRATESFAI committed Jan 10, 2025
1 parent 95d1b7b commit 1455cd1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions solutions/challenge_9/sum_of_digits.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
@author: Semira Tesfai
"""


def sum_of_digits(n: int) -> int:
"""Calculate the sum of the digits of a positive integer.
Expand Down
9 changes: 5 additions & 4 deletions solutions/tests/challenge_9/test_sum_of_digits.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"""

import unittest
from sum_of_digits import sum_of_digits
from solutions.challenge_9.sum_of_digits import sum_of_digits


class TestSumOfDigits(unittest.TestCase):
"""Tests for the sum_of_digits function."""
Expand All @@ -30,8 +31,8 @@ def test_invalid_input(self):
with self.assertRaises(AssertionError):
sum_of_digits(4.5)
with self.assertRaises(AssertionError):
sum_of_digits('123')
sum_of_digits("123")

if __name__ == '__main__':
unittest.main()

if __name__ == "__main__":
unittest.main()

0 comments on commit 1455cd1

Please sign in to comment.