Skip to content

Commit b477a43

Browse files
committed
Adding Bubble_Sort.py
1 parent 29a3c46 commit b477a43

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Bubble_Sort.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#Bubble sort for user input.
2+
3+
def bubble_sort(L):
4+
t=len(L)
5+
for i in range(len(L)-1):
6+
for j in range(t-1):
7+
if L[j]>L[j+1]:
8+
L[j],L[j+1]=L[j+1],L[j]
9+
t-=1
10+
print(L)
11+
12+
#__main()__
13+
X=list(map(int,input().split()))
14+
bubble_sort(X)

0 commit comments

Comments
 (0)