0
Colleagues, I have a problem inserting values into a list, follow the thought:
lista = []
for i in range(0, 4):
lista[i] = int(input('Informe um numero: '))
for i in range(0, len(lista)-1):
for j in range(i + 1, len(lista)):
if lista[i] > lista[j]:
aux = lista[i]
lista[i] = lista[j]
lista[j] = aux
print(lista)
You won’t even explain WHAT PROBLEM you’re having?!
– Gabriel
The first loop I made was to fill in the error list. I know the logic of the second one is right because I have tested it with a list made.
– Fabricio Paiva