Skip to content

homework to lesson 8#11

Open
zagidulin wants to merge 1 commit intomasterfrom
lesson_8
Open

homework to lesson 8#11
zagidulin wants to merge 1 commit intomasterfrom
lesson_8

Conversation

@zagidulin
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

@Dzhoker1 Dzhoker1 left a comment

Choose a reason for hiding this comment

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

Оставил комментарии по коду

Comment thread les_8_task_1.py
for i in range(len(string)):
for j in range(i + 1, len(string) if i == 0 else len(string) + 1):
bar.append(hashlib.sha1(string[i:j].encode('utf-8')).hexdigest())
return len(set(bar))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

А если сразу использовать set не нужно будет тратить память на list. Даже не сохранив множество в переменную вы тратите память на его формирование.

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