Advertisement
Spocoman

04. Palindrome Strings

Feb 10th, 2022
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. lst = input().split(' ')
  2. palindrome = input()
  3.  
  4. lst = [x for x in lst if x == x[::-1]]
  5. number = len([x for x in lst if x == palindrome])
  6.  
  7. print(f'{lst}\nFound palindrome {number} times')
  8.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement