Skip to content

Commit 70831d5

Browse files
authored
Create sort.py
1 parent 0a2bd74 commit 70831d5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

sort.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
l=input().split()
2+
3+
#Modified the same object in ascending order.Returns nothing.
4+
l.sort()
5+
6+
#Modified the same object in descending order.Returns nothing.
7+
l.sort(reverse=True)
8+
9+
#Returns a new ascendingly ordered sorted list.
10+
sorted(l)
11+
12+
#Returns a new descendingly ordered sorted list.
13+
sorted(l,reverse=True)
14+
15+
#These all functions use Tim Sort.

0 commit comments

Comments
 (0)