Python program to add elements to the dictionary. 

In this python dictionary program, we will add elements to the dictionary.

Steps to solve the program
  1. Create an empty dictionary by using {}.
  2. Add elements to the dictionary.
  3. To add elements use the following format: Dictionary_name[key_name] = value.
  4. Print the output.

Output :

				
					dictionary = {}
dictionary["Name"] = "Ketan"
dictionary["Age"] = "21"

print(dictionary)
				
			
				
					{'Name': 'Ketan', 'Age': '21'}
				
			

print the square of all values in a dictionary.

Leave a Comment