Python program to remove the given key from a dictionary

By: Editorial Staff | Last Updated: | In: Python Programming


Today we are going to share a Python program to remove the given key from a dictionary. If you are a python beginner and want to start learning the python programming, then keep your close attention in this tutorial as I am going to share a Python program to remove the given key from a dictionary.

Python program to remove the given key from a dictionary code

Copy the below python program and execute it with the help of python compiler.

Output

Initial dictionary
{‘a’: 1, ‘c’: 3, ‘b’: 2, ‘d’: 4}
Enter the key to delete(a-d):c
Updated dictionary
{‘a’: 1, ‘b’: 2, ‘d’: 4}

Share this post!


About: Editorial Staff

Editorial Staff at FreeWebMentor is a team of professional developers leads by Prem Tiwari