Trying to convert an list to dictionary but could no get expected output
p = {}
a = ["s","l","y"]
for s in a:
p["size"] = s
print(p)
output:
{'size': 'y'}
but i am expecting output like this
{'size': 's','size': 'l','size': 'y'}
how could i acheive this in python
dictkey should be uniquepyou're trying to create, and you dop['size']. What do you want to happen?