Is this a correct way to implement bubble sort? I get a sorted list, but I have a doubt that the method is correct.
# Input unsorted list
size_lis = int(input("enter the size of the list"))
size = 0
list1 = list()
while (size < size_lis):
element = int(input("enter the element"))
list1.append(element)
size += 1
# Sort
for i in range(0, len(list1)):
for j in range(0, len(list1)-1):
if list1[j] > list1[j+1]:
list1[j],list1[j+1] = list1[j+1],list1[j]
print(list1)