Skip to content

Conversation

@inf0rcer
Copy link

Выполнил задания easy и normal


fruit_pack = ['яблоко', 'банан', 'киви', 'арбуз']
for i in range(0, len(fruit_pack)):
print(str(i + 1) + '.' + '{:>7}'.format(fruit_pack[i]))

Choose a reason for hiding this comment

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

подумайте что будет если в списке окажется слово которое будет по длине больше чем 7 символов

Comment on lines +26 to +30
first_pack = ['1', '2', '3', '4', '5', '6', '7']
second_pack = ['1', '3', '6']
for item in second_pack:
if item in first_pack:
first_pack.remove(item)

Choose a reason for hiding this comment

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

вангую, ваше решнеие не будет работать на следующих данных:

first_pack = ['1', '1', '2', '3', '3', '4', '5', '6', '6', '7']
second_pack = ['1', '3', '6']

Comment on lines +38 to +44
for key in dic_days:
if date_check[0] == key:
date_check[0] = dic_days[key]

for key in dic_months:
if date_check[1] == key:
date_check[1] = dic_months[key]

Choose a reason for hiding this comment

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

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

if date_check[1] == key:
date_check[1] = dic_months[key]

print(date_check[0] + ' ' + date_check[1] + ' ' + date_check[2] + ' ' "года")

Choose a reason for hiding this comment

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

забыли про format

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