Python Bubble sort code
Your code's quite good. I'd however change it in the following ways:


Move the creation of the lits out of the buble_sort.
Remove the prints from buble_sort.
Follow PEP8.
Change for i in range(...) to while True:.
Use better variables. num_list to array could do.
Use str.format, rather than string addition.
Change the creation of num_list to use a list comprehension.




def bubble_sort(array):
    while True:
        swapped = False
        for j in range(len(array)-1):
            if array[j] &gt; array[j+1]:
                array[j], array[j+1] = array[j+1], array[j]
                swapped = True
        if not swapped:
            break


if __name__ == '__main__':
    amount = input("How many numbers you would like to sort:")
    array = [
        int(input("Enter {} number:".format(i)))
        for i in range(int(amount))
    ]

    print("The values input are as follows: {}".format(array))
    bubble_sort(array)
    print("The sorted list is: {}".format(array))