Python program to access the dictionary key.

In this python dictionary program, we will access the dictionary key.

Steps to solve the program
  1. Take a dictionary as input.
  2. Use for loop with keys() function to access the keys of the dictionary.
  3. Print the output.
				
					D1 = {"pepsi":50,"sprite":60,"slice":55}

for key in D1.keys():
    print(key)
				
			

Output :

				
					pepsi
sprite
slice
				
			

remove keys with substring values.

filter even numbers from a given dictionary value.

Leave a Comment