Skip to content

Lesson_5#5

Open
dzashivalov wants to merge 1 commit intomainfrom
Lesson_5
Open

Lesson_5#5
dzashivalov wants to merge 1 commit intomainfrom
Lesson_5

Conversation

@dzashivalov
Copy link
Owner

No description provided.

line = input('введите текст, для окончания ввода оставте пустую строку: ')
if not line:
break
print(line, file=perf) No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

выполнено

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

выполнено

for name, creep in creeps.items():
if creep < 20000:
print(name)
print(f'средняя з\п равна {sum(creeps.values()) / len(creeps)}') No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

выполнено


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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

выполнено

print('Некорректные данные!')


summary() No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

выполнено

@@ -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})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

выполнено


js_str = json.dumps(profit)
print(f'Создан файл с расширением json со следующим содержимым: \n '
f' {js_str}') No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

выполнено

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants