odd print order

+2 Stanciu Bogdan Mircea · May 13, 2015
when you printed the k and v values, did python order alphabetically the values? seems so.... 

Post a Reply

Replies

Oldest  Newest  Rating
+1 Colonel Panic · May 14, 2015
There is no context for this question. 
0 Stanciu Bogdan Mircea · May 14, 2015
i thought this will be a comment for the video i was watching when i wrote that.

i was watching  https://www.thenewboston.com/videos.php?cat=98&video=20125   
0 Milan Todorovic · May 16, 2015
As far as I remember, the dictionary doesn't care about order. When you print stuff out, it will be in random order.
0 Colonel Panic · May 17, 2015
You can print them in a sorted fashion if you like 

dict.sort(cmp=None, key=None, reverse=False)
Sort the items of the list in place (the arguments can be used for sort customization, see sorted() for their explanation).

dict.reverse()
Reverse the elements of the list, in place.
  • 1

Python

107,287 followers
About

This section is all about snakes! Just kidding.

Links
Moderators
Bucky Roberts Administrator