0% found this document useful (0 votes)
5 views2 pages

Program No 7

Uploaded by

prashantrawat763
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Program No 7

Uploaded by

prashantrawat763
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Program Number- 07

Date-21/10/2021
Aim: Write a program to demonstrate working with dictionaries in
python.
Software: online python compiler
Algorithm:
Step1 : Enter the employee data in the list(i.e. Name, age ,
salary , company ).
Step 2 : Print the employee type.
Step3 : Print the statement of inserting employee data and print
it.
Step4 : Now print delete some of the employee data.
Step5: Delete Name and Company Name from the list and print
the modified information.
Step6 : Now try to delete the whole dictionary(i.e. Employee).
Step7 : Now print the statement and print employee.
Step8 : Output of the program.

Program:
Employee={“Name”: “Prashant Rawat”, “Age”:22,
“Salary”:10000000, “Company”: “Apple”}
print(type(Employee))
print(“Printing Employee data….”)
print(Employee)
print(“printing employee data”)
print(“Name : %s” %Employee[“Name”])
print(“Age : %d” %Employee[“Age”])
print(“Company : %s” %Employee[“Company”])
print(“Deleting some of the employee data”)
del Employee[“Name”]
del Employee[“Company”]
print(“printing the modified information”)
print(Employee)
print(“Deleting the dictionary : Employee”);
del Employee
print(“Let’s try to print it again”);
print(Employee)
Output :

You might also like