From 148b50e127ee5b17c86f0e1b2964696cf196c87b Mon Sep 17 00:00:00 2001 From: Emanfalouji Date: Sat, 11 Jan 2025 20:31:05 -0500 Subject: [PATCH] EDITIND Doc. --- solutions/check_number_type.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/solutions/check_number_type.py b/solutions/check_number_type.py index 2e38f7933..517c4b593 100644 --- a/solutions/check_number_type.py +++ b/solutions/check_number_type.py @@ -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