Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Some help with Dictionaries
#4
(Jan-19-2021, 06:57 AM)Oshadha Wrote: When you mean expensive, you mean from time & resources right?

A dict consumes more memory as a tuple or list.
Creating a dict is slow. To find a key in a dict is very fast independent of the dict size.

You've to think about this problem, if the size is big enough, but not for 4 elements.

This overhead is important if you work later with data where you have data shaped like 1.000.000 x 10.
Oshadha likes this post
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
Some help with Dictionaries - by Oshadha - Jan-19-2021, 06:23 AM
RE: Some help with Dictionaries - by bowlofred - Jan-19-2021, 06:46 AM
RE: Some help with Dictionaries - by Oshadha - Jan-19-2021, 06:57 AM
RE: Some help with Dictionaries - by DeaD_EyE - Jan-19-2021, 08:48 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020