def bubbleSort(list):
    for i in range(len(list)):
         for j in range(len(list) - 1):
             if list[j] > list[j+1]:
                 list[j], list[j+1]=list[j+1], list[j]
    return list

print(bubbleSort([3,6,1,9,4,7]))