bubble sorting - Dhruv saegal

l1=[29,66,11,2,96,35]
l=len(l1)
print ("Unsorted List:",l1)
for i in range(l):
    for j in range(i):
        if l1[j]>l1[j+1]:
            temp=l1[j]
            l1[j]=l1[j+1]
            l1[j+1]=temp
            
print("Sorted List:",l1)

Comments