Computer Science, asked by banerjeesubhojit92, 5 months ago

c. Below are the two lists convert it into the dictionary
keys = ['Ten', 'Twenty', 'Thirty')
values = (10, 20, 30)​

Answers

Answered by anindyaadhikari13
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