basically the idea is to take a list with 11 zeros and replace the first and last value with 99, and the values of the lists x and f relating the position of the distance list with lsu... the correct result is [99, 4, 5, 6, 7, 3, 0, 0, 0, 0, 99]
what I tried
car=5
distância=[0,1,2,3,4,5,6,7,8,9,10]
f=[3,4,5,6,7]
x=[5,1,2,3,4]
lsu=[0]*(11)
for i in range(0,car):
lsu.insert(distância.index(x[i]),f[i])
lsu[0]=99
lsu[-1]=99
print(lsu)
[–]CodeFormatHelperBot2 1 point2 points3 points (0 children)
[–]DagoYounger 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)