Skip to content

Commit

Permalink
added the README file for challenge_8
Browse files Browse the repository at this point in the history
  • Loading branch information
SEMIRATESFAI committed Jan 9, 2025
1 parent 2cff250 commit 8040098
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions solutions/challenge_8/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Challenge: Palindrome Detector

## Description

The "Palindrome Detector" challenge involves determining if a given string
or bytes is a palindrome.
A palindrome is a word, phrase, or sequence that reads the same backward as
forward, ignoring spaces, punctuation, and case.

Write a function that takes a string or bytes as input and returns `True` if
it is a palindrome, and `False` otherwise.

For example:

- The string `A man, a plan, a canal, Panama` is a palindrome.
- The string `hello` is not a palindrome.
- The bytes `b"racecar"` is a palindrome.
- The bytes `b"hello"` is not a palindrome.

## Example

```python
is_palindrome("A man, a plan, a canal, Panama")
# Output: True (ignoring spaces, punctuation, and case)

is_palindrome("hello")
# Output: False (not a palindrome)

is_palindrome(b"racecar")
# Output: True (ignoring spaces, punctuation, and case)

is_palindrome(b"hello")
# Output: False (not a palindrome)

0 comments on commit 8040098

Please sign in to comment.