Skip to content

Commit

Permalink
EDITIND Doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Emanfalouji committed Jan 12, 2025
1 parent c36b659 commit 148b50e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions solutions/check_number_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,25 @@ def check_number_type(user_input: str) -> str:
Parameters:
user_input (str): str
Raises:
AssertionError: if the argument is not a integer or empty
ValueError: If the input is empty.
ValueError: If the input is not a valid integer.
Returns:
results will be a text whether "The number is even", "The number is odd"
or "Enter a valid number "
or raises an appropriate error.
Examples :
>>> check_number_type("20")
"The number is even"
>>> check_number_type("11")
"The number is odd"
>>> check_number_type("-11")
"The number is odd"
>>> check_number_type("")
"Input cannot be empty. Enter a valid number."
>>> check_number_type("Eman")
"Enter a valid number"
"""
user_input = user_input.strip()
# Check if it is empty
Expand Down

0 comments on commit 148b50e

Please sign in to comment.