Advertisement
PlotnikovPhilipp

Untitled

Sep 11th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. import random
  3. arr = random.sample([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 10)
  4. for i in range(len(arr)):
  5.     for j in range(len(arr) - 1):
  6.         if arr[j] > arr[j+1]:
  7.             a = arr[j]
  8.             arr[j] = arr[j+1]
  9.             arr[j+1] = arr[j]
  10. print(arr)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement