# Check if a string is a palindrome

> Compare a Python string with its reversed slice to check whether it is a palindrome.

- Canonical: https://preview.arshadmehmood.com/today-i-learned/python/check-palindrome/
- Section: python
- Author: Arshad Mehmood

Slicing is the way to go.

```py
def isPalindrome(s): 
    return s == s[::-1] 
```

