Skip to content

Conversation

kalenikai
Copy link

Lesson_3 files

val = rnd.randint(1, 5)
resdict.update(i = val)

fill_dict(10000000) No newline at end of file
Copy link
Owner

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.

Я еще дописал функцию (fill_dict_1 ) заполняющую словарь через генератор и получил время все равно хуже, чем заполнение списка. Я так понимаю, что работа со списком реализована оптимальнее.

Execution time for <function fill_list at 0x000001F2723E28B0> is 7.2645058 sec
Execution time for <function fill_dict at 0x000001F2723E29D0> is 8.423135600000002 sec
Execution time for <function fill_dict_1 at 0x000001F2723E2B80> is 8.650617299999999 sec

else:
break


Copy link
Owner

Choose a reason for hiding this comment

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

хорошо

continue
else:
s.add(inp_str[i:j])
print(s) No newline at end of file
Copy link
Owner

Choose a reason for hiding this comment

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

хорошо

if answer.lower() == 'y':
continue
else:
break No newline at end of file
Copy link
Owner

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