๐งช Programming
โฑ๏ธ 12s
๐ 411 chars
๐ฆ 1.2B
๐ง Q8_0
Prompt: Write a Python function is_palindrome(s) that returns True if s is a palindrome. One test case.
Response
Here's a simple Python function to check if a string is a palindrome:
```python
def is_palindrome(s):
return s == s[::-1]
```
This function works by using slicing to reverse the input string, and then
comparing it with the original string. If they're equal, then the string is
is a palindrome.
Here's an example test case:
```python
print(is_palindrome("radar")) # Expected output: True
```