There was an error while loading. Please reload this page.
1 parent 46619da commit 8525a51Copy full SHA for 8525a51
Tuples/11.py
@@ -0,0 +1,10 @@
1
+# Even Shorter Version
2
+
3
4
+c = {'a' : 10, 'b' : 1, 'c' : 22}
5
+print(sorted([(v,k) for k,v in c.items()]))
6
7
+# List comprehension creates a dynamic list.
8
9
+# In this case, we make a list of reveresd tuples and then sort it
10
0 commit comments