dont want to use range function . can anyone tell me what should i use in case of range funtion

Viewed 33
x = [44, 55, 33, 22, 88, 99]
for I in range(1, Len(x)):
    for j in range(I, 0, -1):
        if x[I] < x[I - 1]:
            a = x[I]
            x[I] = x[I - 1]
            x[I - 1] = a
            I = I - 1
            print(x)
0 Answers
Related