Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- text = input("Enter the text: ")
- text_lower = [s.lower() for s in text]
- # text_lower = text_lower.replace(" ", "")
- i = 0
- j = len(text_lower) - 1
- is_palindrome = True
- while i < j:
- if text_lower[i] != text_lower[j]:
- is_palindrome = False
- break
- i += 1
- j -= 1
- if is_palindrome:
- print("Yes")
- else:
- print("No")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement