Bubble sort

a bubble sort is a type of sort that is used it sort numbers by comparing one number to the next and swapping them if the second one is bigger than the first and if not it will compair the second with a third and so on until it gets to the end of the list when it will go back to the start and repeat the process until it can go through the whole list and make no changes (there is a graphical exampel bellow)
if you want to write this in code there are a few things you need to do as well as getting a loop to check through the numbers and swap them you will need to make sure that the loop stops at the end of the list and does not try to carry on, you will also need to make sure that the program stops after it has finished sorting here is some code that would work in python although keep in mind there are other methods.

import random
numbers = []
for x in range (random.randint(1, 30)):
 numbers.append(random.randint(1, 100))
for x in range (len(numbers)):
 print (numbers [x])
#counting value
c = 0
nosort = 0
end = 0
l = len(numbers)-1
print("random list:", numbers)
print("random ist length:", l+1)
while True:
 if c >= l:
 elif numbers[c+1] < numbers[c]:
  temp = numbers[c]
  numbers[c] = numbers[c+1]
  numbers[c+1] = temp
  nosort = 0
 elif nosort >= len(numbers):
  print("list sorted:", numbers)
  nosort = nosort + 1
  c = c+1