I appended a list into another list, via loop. But I want to access the individual inputs, so I can print them line by line. I am attempting to make an inventory sheet for cars, but I want it to look neat
car = []
cars = []
add = "yes"
loopcars = 0
loopcar = 0
while(add == "yes"):
make = input("Make: \n")
model = input("Model: \n")
year = input("Year: \n")
miles = input("Miles: \n")
price = input("Max bid: \n")
car = [make, model, year, miles, price]
cars.append(car)
add = input("Add a Vehicle?(yes or no)")
while(loopcars != len(cars)):
loopcars = loopcars + 1
while(loopcar != len(cars[loopcar])):
print (cars[loopcar])
loopcar = loopcar + 1
This is the output
Make:
Chevy
Model:
Impala
Year:
2005
Miles:
125000
Max bid:
3500
Add a Vehicle?(yes or no)yes
Make:
Ford
Model:
Escape
Year:
2010
Miles:
127000
Max bid:
4500
Add a Vehicle?(yes or no)no
['Chevy', 'Impala', '2005', '125000', '3500']
['Ford', 'Escape', '2010', '127000', '4500']
I want it to list out like:
Chevy
Impala
2005
125000
3500
etc...