You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
188 B
14 lines
188 B
11 years ago
|
l = [1, 3, 2, 5]
|
||
|
print(l)
|
||
|
l.sort()
|
||
|
print(l)
|
||
|
l.sort(key=lambda x: -x)
|
||
|
print(l)
|
||
|
l.sort(key=lambda x: -x, reverse=True)
|
||
|
print(l)
|
||
|
l.sort(reverse=True)
|
||
|
print(l)
|
||
|
l.sort(reverse=False)
|
||
|
print(l)
|
||
|
|