Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Can I restructure my code with a dictionary with a list of individual cars instead of one long list?

Can I restructure my code with a dictionary with a list of individual cars instead of one long list? They currently output like this: ['2014', 'Dodge', 'Charger', 'black', '65000', '2010', 'Chevy', 'Yukon', 'Blue', '100000']

stock = [] : :self._make = ()self._model = ()self._color = ()self._year = self._miles = : self.make : self.model : self.color : self.year : self.miles :print()print()print()print()print() ()print() ::menu = int(input()) menu == : print()year = input() stock.append(year)make = input() stock.append(make)model = input() stock.append(model)color = input() stock.append(color)miles = input() stock.append(miles)print() main() menu == : print()print(stock[:])update1 = input()update2 = input()stock[stock.index(update1)] = update2print() main() menu == : print()print(stock)remove = input()stock.remove(remove)print(, remove) main() menu == : print(stock[:]) menu == : output = open(, ) item stock:output.write( % item)print() main() menu == : print():print() ValueError: print() __name__ == : main()
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question