hey folks, I'm pretty new to programming in general and currently trying to learn python π
I'm prepping for my finals atm and don't know how to proceed with my bubblesort code:
`arr = []
length = int(input("wie lang soll das array sein?"))
for g in range(length):
arr.append (random.randrange(1,200,1))
print(arr)
i = 1
j = 1
while i < length - 1 :
while j < length - 1:
if arr[j] > arr[j+1]:
zwischen = arr[j+1]
arr[j+1] = arr[j]
arr[j] = zwischen
j = j+1
if j == length -1 :
j = 1
i = i+1
print(arr)
`
i know that my code runs forever but I need a hint on how to design j in a way that the program just jumps to the beginning (more efficient ways such as list length descrease will be done later)