I am trying to code the bubble sort algorithm and I am stumbling at the `TypeError: Can't convert 'int' object to str implicitly` and I have no clue as i've checked both `x` and `length` using `isinstance()` and they are both integers.

Here is my code so far:

```
x = 1
list1 = list(input("What numbers need sorting? Enter them as all one - "))
length = len(list1)
print(list1)
while True:
    for i in range(0,length):
        try:
            if list1[i] > list1[i+1]:
                x = list1[i]
                list1.remove(x)
                list1.insert(i+1,x)
                print(list1)
            if list1[i] < list1[i+1]:
                x += 1
                print(list1)
        except IndexError:
            break
    if x == length:
        print("The sorted list is - ",''.join(list1))
        break

```