0 out of 464 challenges solved
Write a Python function `check_char(string)` that checks whether the given string starts and ends with the same character. The function should return `"Valid"` if the string starts and ends with the same character, and `"Invalid"` otherwise. #### Example Usage ```python [main.nopy] check_char("abba") # Output: "Valid" check_char("a") # Output: "Valid" check_char("abcd") # Output: "Invalid" ``` #### Constraints - The input string will only contain lowercase alphabetic characters (`a-z`). - The input string will have a length of at least 1.
def check_char(string): """ Check if the given string starts and ends with the same character. Args: string (str): The input string to check. Returns: str: "Valid" if the string starts and ends with the same character, "Invalid" otherwise. """ # Implement the function logic here pass