Guest User

Untitled

a guest
Oct 15th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. #Задание № 1
  2. def pangram_check(eng=True):
  3. import string
  4. a = str(input('Введите предложение', ))
  5. #a = a.replace(" ", "")
  6. a = a.lower()
  7. znaki = set(string.punctuation)
  8. a = ''.join(x for x in a if x not in znaki)
  9. white_sp = string.whitespace
  10. a = ''.join(x for x in a if x not in white_sp)
  11. list_a = []
  12. for x in a:
  13. list_a.append(x)
  14. if eng:
  15. z = list(string.ascii_lowercase)
  16. else:
  17. z = list('абвгдеёжзийклмнопрстуфхцчшщъыьэюя')
  18. lacks = []
  19. for item in z:
  20. if item in list_a:
  21. continue
  22. else:
  23. lacks.append(item)
  24. if lacks != []:
  25. print('Не хватает букв:', lacks)
  26. return 0
  27. else:
  28. print('Текст является панграммой!')
  29. return 1
Add Comment
Please, Sign In to add comment