Guest User

lol kek

a guest
May 13th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. arr = [ 5, 4, 100, -2, 0, 6, 4]
  2.  
  3.  
  4. for i in range(len(arr)):
  5.     for j in range(len(arr)-1):
  6.         if arr[j] > arr[j+1]:
  7.             c = arr[j];
  8.             arr[j] = arr[j+1]
  9.             arr[j+1] = c           
  10.  
  11.  
  12. print(arr)
  13. print(f"Size array = {len(arr)}")
Advertisement
Add Comment
Please, Sign In to add comment