Sep-21-2020, 09:57 AM
Sep-21-2020, 10:18 AM
Quote:Dictionary is an unordered, changeable and indexed collection of items.
This is
True
for Python <= 3.5.Since Python 3.6 it's an implementation detail, that the insertion order is preserved.
Since Python 3.7 it's a language feature.
To make a list unique and keep the insertion order:
my_list = [1,1,1,3,-5,4,1] unique_keys = list(dict.fromkeys(my_list))
Sep-21-2020, 11:25 AM
Is it just me or there is really influx of links to substandard tutorials?