I have a TXT file with numbers separated by spaces and I want to sequence from the smallest number to the largest, only the numbers on the first line of that file. The sequencing logic I believe I have achieved:
tam_entrada = len(lista)
for i in range (tam_entrada):
for j in range (1, tam_entrada-i):
if lista[j] < lista[j-1]:
lista[j], lista[j-1] = lista[j-1], lista[j]
print(lista)
But I can not import the first line of the file as a vector that I named lista
. Can someone help me, please?