Skip to content

Commit 8525a51

Browse files
committed
Even Shorter Version
1 parent 46619da commit 8525a51

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Tuples/11.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)