Skip to content

Conversation

@aka-nomad
Copy link

No description provided.

sex = 'мужской'
else:
sex = 'женский'
print(f"{names[i]}: {sex}")

Choose a reason for hiding this comment

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

А тут укажем "Станислав" в names и он станет девочкой :)

Copy link
Author

Choose a reason for hiding this comment

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

а как обойти это если у нас задан строго словарь с именами и полом?

group = i + 1
print(f"Группа {group}:", end=' ')
for j in range(0, len(groups[i])):
print(f"{groups[i][j]}")

Choose a reason for hiding this comment

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

А вот тут есть несоответствие условию. Нужно имена через запятую соединить...
Тут лучше бы пошло:
group_content = ', '.join(groups[i])

Copy link
Author

Choose a reason for hiding this comment

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

вот я не догадался как это сделать

Copy link
Author

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