-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Homework added #6
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправить важно только подсчет мальчиков и девочек. Остальное здорово!
delta_30days = datetime.timedelta(days=30) | ||
|
||
yesterday = dt_now - delta | ||
today = datetime.datetime.today() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Эта строчка дублирует 14ую. Можно не исправлять
new_content = content.replace('.', '!') | ||
|
||
with open('referat2.txt', 'w', encoding='utf-8') as new_essay: | ||
new_essay.write(new_content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great!
writer.writeheader() | ||
|
||
for user in user_info: | ||
writer.writerow(user) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
аккуратно и верно
# all_names.append(name['first_name']) | ||
|
||
# common_name = collections.Counter(all_names).most_common(1) | ||
# print(f'Самое частое имя среди учеников: {common_name[0][0]}') |
There was a problem hiding this comment.
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
# girls += 1 | ||
# return girls | ||
|
||
# def count_boys_in_class(clas, names_info): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше объединить подсчет мальчиков и девочек в одну функцию и возвращать
return boys, girls
Эту правку лучше сделать для практики
] | ||
|
||
i = 1 | ||
for group in groups: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут можно использовать enumerate() в остальном в этом файле всё ок
total_len_words += len(word) | ||
|
||
average_len = total_len_words / len(sentence.split()) | ||
print(average_len) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
No description provided.