Python Dictionary Update method- my programming school

Python Dictionary Update method with example

 Dictionary in Python is an unordered group of data values, used to store data values like a map, which, unlike other data types that carry only a single value as an element, Python dictionary holds pair. In Python Dictionary update method updates the dictionaries with the elements from different dictionary object or from an iterable of key/value pairs.

It uses to replace what is already is used and add more data to dictionaries



Python dictionary update method Example 

user_info = {'name': 'pramod', 'age': 22, 'rollno': '17691a05b9', 'class': 'B-Tech'}
print(f'Before to update userinformation:{user_info}')
more_info={'name':'pramod kumar yadav','state': 'Janakpur','country':'Nepal'}
print(f'After update user information{user_info}')


C:\Users\Pramod\PycharmProjects\pythonProject\venv\Scripts\python.exe C:/Users/Pramod/PycharmProjects/pythonProject/
Before to update userinformation:{'name': 'pramod', 'age': 22, 'rollno': '17691a05b9', 'class': 'B-Tech'}
more_info={'name': 'pramod kumar yadav', 'state': 'Janakpur', 'country': 'Nepal'}
After update user information{'name': 'pramod kumar yadav', 'age': 22, 'rollno': '17691a05b9', 'class': 'B-Tech', 'state': 'Janakpur', 'country': 'Nepal'}

Process finished with exit code 0
Python Dictionary Update method


learn salesforce

Hi, I’m Pramod Kumar Yadav & a computer science Engineer with 3years of experience in Digital marketing. I’m self-motivated and love to do SEO.

1 thought on “Python Dictionary Update method- my programming school”

Leave a Reply

%d bloggers like this: