Skip to content

Homework added - #6

Open
Ksenia2102 wants to merge 1 commit into
learnpythonru:masterfrom
Ksenia2102:master
Open

Homework added#6
Ksenia2102 wants to merge 1 commit into
learnpythonru:masterfrom
Ksenia2102:master

Conversation

@Ksenia2102

Copy link
Copy Markdown

No description provided.

@alexandrettioalexandrettio left a comment

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 thread1_date_and_time.py
delta_30days = datetime.timedelta(days=30)

yesterday = dt_now - delta
today = datetime.datetime.today()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Эта строчка дублирует 14ую. Можно не исправлять

Comment thread2_files.py
new_content = content.replace('.', '!')

with open('referat2.txt', 'w', encoding='utf-8') as new_essay:
new_essay.write(new_content)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

great!

Comment thread3_dict_to_csv.py
writer.writeheader()

for user in user_info:
writer.writerow(user)

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 threadlesson2/dicts.py
# all_names.append(name['first_name'])

# common_name = collections.Counter(all_names).most_common(1)
# print(f'Самое частое имя среди учеников: {common_name[0][0]}')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

в таком месте лучше не делать [0][0] а распаковать
most_common = common_name[0]
name, amount = most_common

Comment threadlesson2/dicts.py
# girls += 1
# return girls

# def count_boys_in_class(clas, names_info):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Лучше объединить подсчет мальчиков и девочек в одну функцию и возвращать
return boys, girls

Эту правку лучше сделать для практики

Comment threadlesson2/for.py
]

i = 1
for group in groups:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Тут можно использовать enumerate() в остальном в этом файле всё ок

Comment threadlesson2/strings.py
total_len_words += len(word)

average_len = total_len_words / len(sentence.split())
print(average_len) 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.

👍

Sign up for freeto 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

@Ksenia2102@alexandrettio