Python program to get the total length of a dictionary.

In this python dictionary program, we will get the total length of a dictionary.

Steps to solve the program
  1. Take a dictionary as input.
  2. Use the len() function to calculate the length of the dictionary.
  3. The len() function will return the key-value pairs in the dictionary.
  4. To get the total number of items in the dictionary multiply the len() function by 2.
  5. Print the output.
				
					D1 = {'virat':50,'Rohit':40,'Rahul':25}

print(len(D1)*2)
				
			

Output :

				
					6
				
			

create key-value list pairings in a given dictionary.

group the elements of a given list based on the given function.

Leave a Comment