2
Associate two lists, a car name list and another color list and each containing n elements:
listaCarros = ["gol","uno","corsa","palio","idea"]
listaCores = ["branco","verde","preto","cinza","azul"]
with the output in this format:
"The goal is white"
I did the following:
n=0
while n <= 5:
print("\nO", end=' ')
print(listaCarros[n],end=' é ')
print(listaCores[n])
n = n + 1
worked, but this message appeared:
Traceback (Most recent call last): "file path" line 286, in print(listCarros[n],end=' is ') Indexerror: list index out of range
would have a better way of doing that?
@Miguel is very simple.... Serie listaCarros = ["gol","Corsa","Palio"] and other colors in the same way. And in case associate the two just to print in that format, worked out the way I did, but is giving this msg of Indexerror and if by chance there is a better way to do it
– William Henrique
I’m building an answer William
– Miguel