Skip to content

Conversation

@PetrovSt89
Copy link
Owner

No description provided.

names = ['Оля', 'Петя', 'Вася', 'Маша']
# ???
for name1 in names:
print(name1)

Choose a reason for hiding this comment

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

👍

names = ['Оля', 'Петя', 'Вася', 'Маша']
# ???

for name3 in names:

Choose a reason for hiding this comment

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

💡 можно не менять названия переменным и использовать тот же name

names = ['Оля', 'Петя', 'Вася', 'Маша']
# ???
for name in names:
if is_male[name] == False:

Choose a reason for hiding this comment

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

💡 еще можешь использовать тернарный оператор:

gender = 'мужской' if is_male[name] else 'женский'

['Оля', 'Петя', 'Гриша'],
]
# ???
for group in range(1,len(groups)+1):

Choose a reason for hiding this comment

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

👍 хорошее решение, есть еще попроще метод (а мы такие любим):

for idx, group in enumerate(groups, start=1):

]
# ???
for name in range(len(groups)):
names = ', '.join(groups[name])

Choose a reason for hiding this comment

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

👍

]
# ???
repeat = diction_name_count(students)
def max_name(diction):

Choose a reason for hiding this comment

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

💡 Непонятно без контекста, что там в этом diction

repeat = diction_name_count(students)
def max_name(diction):
max_count = 0
for name,count in diction.items():

Choose a reason for hiding this comment

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

👍 реализация верная

# ???

for classes in range(len(school_students)):
print(f'Самое частое имя в классе {classes+1}: {max_name(diction_name_count(school_students[classes]))} ')

Choose a reason for hiding this comment

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

👍 очень здорово, что пользуешься переиспользованием функций
💡 тут лучше бы зашел str.format, а не f-strings

for n in student:
name = n['first_name']
if is_male[name] == True:
boys.append(name)

Choose a reason for hiding this comment

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

💡 в целом верно, но тот же коммент, что вместо списка можно было бы просто использовать переменную число мальчиков и такую же для девочек и увеличивать его на 1

count_boys = len(boys)
count_girls = len(girls)

if count_boys > clas_count_boys:

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.

3 participants