Skip to content

Commit

Permalink
final editing
Browse files Browse the repository at this point in the history
  • Loading branch information
Emanfalouji committed Jan 12, 2025
1 parent f389067 commit 26f0653
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions solutions/check_number_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def check_number_type(user_input: str) -> str:
Parameters:
user_input (str): A string that represents an integer.
user_input (str): str
A string that represents an integer.
Floats or non-integer formats are not allowed.
Raises:
ValueError: If the input is empty.
Expand All @@ -31,9 +32,15 @@ def check_number_type(user_input: str) -> str:
>>> check_number_type("-11")
"The number is odd"
>>> check_number_type("")
"Input cannot be empty. Enter a valid number."
Traceback (most recent call last):
...
.ValueError:"Input cannot be empty. Enter a valid number."
>>> check_number_type("Eman")
"Please enter a valid number"
Traceback (most recent call last):
...
.ValueError:"Please enter a valid number"
"""
Expand Down
2 changes: 1 addition & 1 deletion solutions/tests/test_check_number_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Test categories:
- Standard cases: typical lists with different lengths
- Edge cases: empty lists, single elements
- Edge cases: empty lists, single element
- Defensive tests: wrong input types, assertions
Expand Down

0 comments on commit 26f0653

Please sign in to comment.