So I have a dictionary which is like -
{'gaining': 34, 'Tinga': 42, 'small': 39, 'legs,': 13,}. Is there a way in which i can print it out so that it becomes a list like -
[ gaining, Tinga, small, legs ] So that only the keys are printed and not the values that go along it. Also is there a way to make the dictionary not work in arbitrary order - such that if two keys are repeated instead of giving it the value of the last one, we give it the value of the first one?
eg;
{'gaining' : 34, 'Tinga' : 42, 'small : 39, 'legs,' : 13 'gaining' : 20} When printed
print dict['gaining'] The output comes as
34 instead of coming as
20
.keys()