Dictionary Practice Paper
Dictionary Practice Paper
Class 11
Dictionary (Revision Worksheet)
Name:_______________ Date:________
Q1. Write a Python program to arrange the values in a dictionary in ascending order.
For example
Original Dictionary = {1 : 25, 2 : 21, 3 : 23}
Expected Output = [21, 25, 32]
Q3. Write a function check(key) which takes a key as an argument and check whether
that key is present in dictionary or not.
Q4.Accept the number of terms say n from the user and display the dictionary in the
form of {n: n*5} for example:
If number of terms entered by user is 4 then the expected dictionary is {1:5, 2:10, 3:
15, 4: 20}
Q8. Write a program to accept a key from the user and remove that key from the
dictionary if present.
Q9. Write a program in python to display the maximum and minimum value in
dictionary.
Q10. Write a program in python to remove the duplicate values from the dictionary.
For example:
Original dictionary = {1 : “Aman”, 2: “Suman”, 3: “Aman”}
New dictionary = {1 : “Aman”, 2: “Suman”}
Q11. Write a program to count the number of elements in a dictionary.
Q12. Accept a key from the user and modify it’s value.
Q13. Write a program to store information of products like product id, product name,
and product price in a dictionary by taking product id as a key.
Q14. Write a program to accept the employee id from the user and display its detail
from the dictionary. Data is stored in the dictionary in the following format
{Empid : (Empname, EmpSalary}
Q14. Write a program to accept the employee id from the user and check Salary. If
salary is less than 25000 then increase the salary by Rs1000. Data is stored in the
dictionary in the following format
{Empid : (Empname, EmpSalary}
Q15. Write a program to display the name of all the employees whose salary is more
than 25000 from the following dictionary.
Q16. Write a program to count the frequency of each word in a given string accepted
from the user using dictionary.
Q17. Write a program to accept roll number, names and marks of five students and
store the detail in dictionary using roll number as key. Also display the sum of marks
of all the five students.
Q18. Write a program to count the frequency of each character in a given string
accepted from the user using dictionary.(Store the character as key and it’s frequency
as value)
***************************