Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [palindromes.append(string) for string in input_text if string == "".join(reversed(string))]
- # или
- palindromes = [string for string in input_text if string == string[::-1]]
- # което е еквивалентно на:
- for string in input_text:
- if string == string[::-1]:
- palindromes.append(string)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement