This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3 | |
| import string | |
| russian_chars = "йцукенгшщзхъфывапролджэячсмитьбюё" | |
| def check_language(text): | |
| english = 0 | |
| russian = 0 | |
| try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3 | |
| from operator import itemgetter | |
| import string | |
| def strip_punctuation(text): | |
| """Убирает знаки препинания из строки. Добавляет пробел в конец новой | |
| строки для упрощения обработки в функции подсчета слов""" | |
| new_text = "" | |
| for ch in text.lower(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3 | |
| qa_dict = { | |
| "Введите значение числа Пи: " : ["3.14", "3,14"], | |
| "Имя автора языка Python: " : ["гвидо", "гвидо ван россум", "гвидо ван\ | |
| росум", "guido van rossum", "guido",], | |
| "Температура тройной точки воды (в градусах Цельсия): " : ["0.01", "0,01"], | |
| } | |
| print('\nДля досрочного завершения работы введите "exit"\n') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3 | |
| def isNumber(string): | |
| numbers = "0123456789" | |
| ops = "-+*/" | |
| num = 0 | |
| op = 0 | |
| char = 0 | |
| for ch in string: | |
| if ch in numbers: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3 | |
| # Эта часть для большей наглядности при | |
| # необходимости добавить вопросы | |
| # и видеть их порядок | |
| question_0 = "Введите значение числа Пи: " | |
| answers_0 = ["3.14", "3,14"] | |
| question_1 = "Имя автора языка Python: " | |
| answers_1 = ["гвидо", "гвидо ван россум", "гвидо ван росум", \ |