Not able to get proper output when tried to use 2 list to make one dictionary
Input is a name list and image list.
name_list = ["Brad Pitt", "Chris Evans"]
image_list = ["http://image_1.png","http://image_2.png"]
-
dict = []
for item in name_lst:
new_item = []
new_item.extend(item.split())
for img in img_url_lst:
new_img.append(img)
dict.append({"FirstName:" : new_item[0], "Lastname:" : new_item[1], "ImageURL:":new_img[img]})
return dict
-
"actors": [
{
"firstName":"Johnny",
"lastName":"Depp",
"imageURL":"http://imageurl/1"
},
{
"firstName":"Ricky",
"lastName":"Martin",
"imageURL":"http://imageurl/2"
}
],
Can somebody help me merge two lists and make a dictionary out of it.