Professional Documents
Culture Documents
Dictionaries
Dictionaries
CLASS: XI
SUB: Computer Science CODE: 083
Chapter – Dictionaries Worksheet Solution
Q7.WAP that repeatedly asks the user to enter product names and prices. Store all of them in a dictionary whose keys are
product names and values are prices. And also write a code to search an item from the dictionary.
Ans:
Q8.WAP to create a dictionary named year whose keys are month names and values are their corresponding number of
days.
Ans:
Q9.WAP to create a dictionary with the rno., name & marks of n students .Also print the record of those who have
scored>75.
d={}
for i in range(2):
rno=int(input("Enter roll no."))
name=input("Enter name")
marks=int(input("Enter marks"))
d['rno']=rno
d['name']=name
d['marks']=marks
for i in d:
if i=='marks' and 'marks'>'75':
print(d)
Q10. Explain shallow copy and deep copy.
refer pg no.468 from book