Valenthtain

Untitled

Jun 22nd, 2021
475
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def bubble_sort(data):
  2.     flag = True
  3.     while changed:
  4.         flag = False
  5.         for i in range(len(data) - 1):
  6.             if data[i] > data[i+1]:
  7.                 data[i], data[i+1] = data[i+1], data[i]
  8.                 flag = True
  9.     return data
  10.  
  11. arr = list(map(int, input().split()))
  12.    
  13. arr = bubble_sort(arr)
  14. print(arr)
RAW Paste Data