After a few days I still cannot figure out how to make this work on python (not an experienced programmer). Here it is the code pasted and at the bottom, the expected result:
color_list = ["red", "blue", "orange", "green"]
secuence = ["color", "price"]
car_list = []
def create_list(color_list, secuence, car_list):
for num in range(len(color_list)):
car_list.append = dict.fromkeys(secuence)
car_list[%s]['color'] = color_list[%s] %num
return car_list
This is the result I want to achieve:
>> car_list
[{'color': 'red', 'price': None},{'color': 'blue', 'price': None},{'color': 'orange', 'price': None},{'color': 'green', 'price': None}]