+ 5
Code won't work, why?
6 Answers
+ 5
Dictionaries don't maintain the order of their elements. Try collections.OrderedDict instead.
EDIT: thought I might mention that dictionaries are ordered from Python 3.6 onward. Sololearn still uses Python 3.5, though, so... yeah.
+ 5
All you need is
print(dic[k])
print(dic2[e])
+ 4
No Problem, thats the joys of programming.
+ 3
@LunarCoffee
Thanks a lot đ . I didn't know that.
+ 3
@Louis
MIND-BLOWING I spent hours trying to find a solution and you tell me that I only need these two simple lines đ±
I guess that's why you are platinum... am just bronze đ
Anyway, HUGE THANK YOU !!!
+ 2
I've tried almost everything and it still won't work:(
If someone knows how to make this code work (i mean, to get the output I want) with collections or without, I would be happy