Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Lesson2#879

Open
inf0rcer wants to merge 2 commits into
GeekBrainsTutorial:masterGeekBrainsTutorial/Python_lessons_basic:masterfrom
inf0rcer:lesson2inf0rcer/Python_lessons_basic:lesson2Copy head branch name to clipboard
Open

Lesson2#879
inf0rcer wants to merge 2 commits into
GeekBrainsTutorial:masterGeekBrainsTutorial/Python_lessons_basic:masterfrom
inf0rcer:lesson2inf0rcer/Python_lessons_basic:lesson2Copy head branch name to clipboard

Conversation

@inf0rcer

Copy link
Copy Markdown

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


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

Copy link
Copy Markdown

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)

Copy link
Copy Markdown

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]

Copy link
Copy Markdown

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] + ' ' "года")

Copy link
Copy Markdown

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.