Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - from random import randint
 - a=[randint(100,500) for i in range(1,100)]
 - n=len(a)
 - count=0
 - for i in range(n-1):
 - for j in range(n-i-1):
 - if a[j+1]<a[j]:
 - a[j], a[j+1]=a[j+1], a[j]
 - count+=1
 - print(count)
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment