Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Задание № 1
- def pangram_check(eng=True):
- import string
- a = str(input('Введите предложение', ))
- #a = a.replace(" ", "")
- a = a.lower()
- znaki = set(string.punctuation)
- a = ''.join(x for x in a if x not in znaki)
- white_sp = string.whitespace
- a = ''.join(x for x in a if x not in white_sp)
- list_a = []
- for x in a:
- list_a.append(x)
- if eng:
- z = list(string.ascii_lowercase)
- else:
- z = list('абвгдеёжзийклмнопрстуфхцчшщъыьэюя')
- lacks = []
- for item in z:
- if item in list_a:
- continue
- else:
- lacks.append(item)
- if lacks != []:
- print('Не хватает букв:', lacks)
- return 0
- else:
- print('Текст является панграммой!')
- return 1
Add Comment
Please, Sign In to add comment