Jan-19-2021, 08:48 AM
(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.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!