c. Below are the two lists convert it into the dictionary
keys = ['Ten', 'Twenty', 'Thirty')
values = (10, 20, 30)
Answers
Answered by
1
Answer:
Given list,
keys = ['Ten', 'Twenty', 'Thirty']
values = (10, 20, 30)
To convert list to dictionary, write the códe given below,
d= dict(zip(keys,values))
print(d) # to print the dictionary.
Explanation:
- zip() :- The zip function is used to convert two iterable items together.
- Using dict() function, d is converted to dictionary.
Similar questions