Skip to content

Commit ee35c30

Browse files
authored
Update itemgetter_sorting_lists.py
1 parent a4d628b commit ee35c30

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

working-with-the-python-operator-module/itemgetter_sorting_lists.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import operator
2+
13
musicians_list = [
24
[1, "Brian", "Wilson", "Beach Boys"],
35
[2, "Carl", "Wilson", "Beach Boys"],
@@ -8,8 +10,6 @@
810
[7, "Brian", "Bennett", "Shadows"],
911
]
1012

11-
import operator
12-
1313
get_id = operator.itemgetter(0)
1414
print(sorted(musicians_list, key=get_id, reverse=True))
1515

0 commit comments

Comments
 (0)