Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def palindrome(word):
- word = word.lower()
- word = word.replace(" ", "")
- reversed_word = word[::-1]
- return word == reversed_word
- text = "А роза упала на лапу Азора"
- if palindrome(text):
- print(f"Строка '{text}' является палиндромом.")
- else:
- print(f"Строка '{text}' не является палиндромом.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement