๐งช Programming
โฑ๏ธ 60s
๐ 429 chars
๐ฆ 9B
๐ง Q4_0
Prompt: Write a Python function is_palindrome(s) that returns True if s is a palindrome. One test case.
Response
```python
def is_palindrome(s):
"""
Checks if a given string is a palindrome.
Args:
s: The string to check.
Returns:
True if s is a palindrome, False otherwise.
"""
# Remove spaces and convert the string to lowercase
s = s.replace(" ", "").lower()
# Compare the string with its reverse
return s == s[::-1]
# Test case
print(is_palindrome("racecar")) # Output: True
```