DEV Community

happy_heart_hacker
happy_heart_hacker

Posted on

BUBBLE SORTING IN PYTHON

a=list(input("Enter the elements of list:"))

for i in range(len(a)):
for j in range(1,len(a)):
if a[j-1]>a[j]:
a[j-1], a[j]=a[j],a[j-1]
print("your sorted list is:\n",a)

Top comments (0)