I have made a simple code of having a dictionary inside a list, how do you add an another element to them? The code is as follow:
Cars = []
Cars.append({"make": "Tesla", "colour": "red"})
print(Cars)
Cars.append({"make": "Toyota", "colour": "green"})
Cars.append({"make": "Ford", "colour": "white"})
print(Cars)
I want it to add a new dictionary element to the list showing year of manufacture so that when I print it shows this
[{'make': Tesla, 'colour': 'red',’year’:2020}
,{"make": "Toyota", "colour": "green",’year’:2020}
,{"make": "Ford", "colour": "white",’year’:2020}
]