Open
Conversation
| line = input('введите текст, для окончания ввода оставте пустую строку: ') | ||
| if not line: | ||
| break | ||
| print(line, file=perf) No newline at end of file |
| with open('File5_1.txt', 'r', encoding='utf-8') as perf: | ||
| res = [f'{line}. {count.strip()} - {len(count.split())} слова' | ||
| for line, count in enumerate(perf, 1)] | ||
| print(*res, f'Всего строк - {len(res)}.', sep='\n') No newline at end of file |
| for name, creep in creeps.items(): | ||
| if creep < 20000: | ||
| print(name) | ||
| print(f'средняя з\п равна {sum(creeps.values()) / len(creeps)}') No newline at end of file |
|
|
||
| with open('File4_ru.txt', 'w', encoding='utf-8') as new_perf: | ||
| with open('text_4.txt', encoding='utf-8') as perf: | ||
| new_perf.writelines([line.replace(line.split()[0], rus.get(line.split()[0])) for line in perf]) No newline at end of file |
| print('Некорректные данные!') | ||
|
|
||
|
|
||
| summary() No newline at end of file |
| @@ -0,0 +1,2 @@ | |||
| with open('text_6.txt', 'r', encoding='utf-8') as perf: | |||
| print({string.split(':')[0]: sum([int(s[:s.index('(')]) for s in string.split() if '(' in s]) for string in perf}) | |||
|
|
||
| js_str = json.dumps(profit) | ||
| print(f'Создан файл с расширением json со следующим содержимым: \n ' | ||
| f' {js_str}') No newline at end of file |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.