Python program to map two lists into a dictionary.

In this python dictionary program, we will map two lists into a dictionary.

Steps to solve the program
  1. Take two lists as input.
  2. Map two lists into a single dictionary using zip() and dict().
  3. Print the output.
				
					list1 =  ['name','sport','rank','age']
list2 =  ['Virat','cricket',1,32]

new_dict = dict(zip(list1,list2))

print(new_dict)
				
			

Output :

				
					{'name': 'Virat', 'sport': 'cricket', 'rank': 1, 'age': 32}
				
			

remove a key from the dictionary.

find maximum and minimum values in a dictionary.

Leave a Comment