Advertisement
nq1s788

Untitled

Sep 1st, 2023
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. def is_word(s):
  2.     alph = 'АаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯя'
  3.     if s[0] == '-':
  4.         return False
  5.     for c in s:
  6.         if not c.isalpha() and c not in alph and c != '-':
  7.             return False
  8.     return True
  9.  
  10.  
  11. text = input().split()
  12. answ = 0
  13. for e in text:
  14.     answ += is_word(e)
  15. print(answ)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement