Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def isPalidnrom(s):
- l = len(s)
- for i in range(l//2):
- if s[i] != s[-1-i]:
- return False
- return True
- s = input('введите строку: ')
- word = input('введите букву: ')
- lst = s.split(',')
- cnt = 0
- for i in lst:
- if (i[0] == word):
- if (isPalidnrom(i)):
- cnt += 1
- print(cnt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement