I input like this -> 10 79 8 51 2
and I want to get [2, 8, 10, 51, 79]
but I get [10, 2, 51, 79, 8]
please tell me what's wrong with my code?
python
list = input().split()
print(list)
for i in range(0, 4):
print(i)
for j in range(i+1, 5):
if list[i] > list[j]:
print(list[i],list[j])
list[i], list[j] = list[j], list[i]
print(list)
else:
print(j, list[i], list[j])
print("don't switch")
list. Use a non-reserved word for variable names instead.10 > 2, but"10" < "2".[10, 2, 51, 79, 8], but['10', '2', '51', '79', '8']. The quotes are significant.