Skip to content

Homework5#5

Open
facelli wants to merge 5 commits into
mainfrom
homework5
Open

Homework5#5
facelli wants to merge 5 commits into
mainfrom
homework5

Conversation

@facelli

@facelli facelli commented Dec 18, 2020

Copy link
Copy Markdown
Owner

No description provided.

Comment thread fifth_lesson/1-st_task.py
# sys.exit()
# else:
# return line
#

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

не оставляй код под комментарием

Comment thread fifth_lesson/1-st_task.py
if line == "":
print("Программа завершена")
break
file.writelines(line)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

+++

Comment thread fifth_lesson/2-nd_task.py
lines=file.readlines()
print(f"В файле {len(lines)} строк.")
i=1
for line in lines:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

+++

Comment thread fifth_lesson/3-d_task.py
# Определить, кто из сотрудников имеет оклад менее 20 тыс., вывести фамилии этих сотрудников.
# Выполнить подсчет средней величины дохода сотрудников.
salary = []
with open("salary.txt", "r") as file:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

+++

Comment thread fifth_lesson/4-th_task.py
# print((lines[0]).split(" — "))
for line in lines:
line = line.split(" — ")
file2.write(f"{dict[line[0]]} - {line[1]}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

блестяще

Comment thread fifth_lesson/6-th_task.py
mod_line = modline.join((num if num.isdigit() else " ") for num in line)
hrs = [int(num) for num in mod_line.split()]
dict[line.split()[0]] = sum(hrs)
print(dict) No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

+++

Comment thread fifth_lesson/5-th_task.py
num=num.split()
for item in num:
sum+=int(item)
# sum+=int(nums)

Copy link
Copy Markdown

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