SlideShare a Scribd company logo
1
CHAPTER: DICTIONARY IN PYTHON
ASSIGNMENT SET – 1
Time: 30 min M.M. – 20
Instructions:
 All Questions are compulsory
 Q1 to Q6 carry 1 mark
 Q7 to Q10 carry 2 marks
 Q11 to Q12 carry 3 marks
Q1. Keys must be ______ in dictionary.(mutable/immutable)
Q2. Write a built in function which is used to create an empty dictionary.
Q3. Write the code to print only keys of the following dictionary.
D = {“Amit” : 40, “Sunil” : 34, “Naina” : 30}
Q4. Write the code to add the following detail in dictionary given above.
“Ravi” – 45
Q5. Write the output of the following code:
D = {“Amit” : 40, “Sunil” : 34, “Naina” : 30}
print(D[‘Amit’] + D[‘Sunil’])
Q6. Name the function which is used to return a value of the given key.
Q7. Write two differences between List and Dictionary.
2
Q8. Write the output of the following:
m = {1 : "Jan", 2 : 'Jun', 3 : 'Aug'}
print(m[1])
print(m["jan"])
Q9. Explain keys() function of dictionary with example.
Q10. Write one similarity and one difference between del statement and
pop() function in reference to dictionary.
Q11. Find errors in the following statement and write the correct code:
num = {1 : 10, 2 : 20, 3 : 30, 4 : 40, 5 : 50}
a) print(num.item())
b) print(num.len())
c) print(pop(5))
Q12. Write a program to input details of five employees in a dictionary
like employee number, employee name, employee salary and display
their details in tabular form.

More Related Content

PDF
CBSE Python String Assignment
PDF
Solidity Tutorials- Function call in solidity
PPTX
Job sequencing with deadline
PPTX
Job sequencing in Data Strcture
PPTX
Asymptotic notation ada
DOCX
Programming-I assignment for BSCS students , NCBA&e
PPT
Admission for b.tech
PDF
A02
CBSE Python String Assignment
Solidity Tutorials- Function call in solidity
Job sequencing with deadline
Job sequencing in Data Strcture
Asymptotic notation ada
Programming-I assignment for BSCS students , NCBA&e
Admission for b.tech
A02

What's hot (7)

PDF
python dict
PDF
CS-141 Java programming II ASSIGNMENT 2
PPTX
C- Programs - Harsh
DOC
PPTX
3. basics of python
PDF
Extending built in objects
python dict
CS-141 Java programming II ASSIGNMENT 2
C- Programs - Harsh
3. basics of python
Extending built in objects
Ad

Similar to CBSE Python Dictionary Assignment (20)

PPTX
dictionary14 ppt FINAL.pptx
PPT
2 UNIT CH3 Dictionaries v1.ppt
PDF
Lecture-6.pdf
PDF
"Python Dictionary: The Key to Efficient Data Storage, Manipulation, and Vers...
PPTX
Dictionary in python
PPTX
Chapter 16 Dictionaries
PPTX
DICTIONARIES TUTORIALS FOR ADVANCED LEARNING OF YTHON PROGRAMMING
PPTX
ch 13 Dictionaries2.pptx
PPT
Dictionarys in python programming language.ppt
PPTX
Unit4-Basic Concepts and methods of Dictionary.pptx
PDF
python dictionaries available in python language
PPTX
Chapter 14 Dictionary.pptx
PPTX
Dictionariesasdfghjsdfghjklsdfghjkl.pptx
PPTX
DICTIONARIES (1).pptx
PPTX
Python programming –part 7
PPTX
Meaning of Dictionary in python language
PPTX
Ch_13_Dictionary.pptx
PDF
STRING LIST TUPLE DICTIONARY FILE.pdf
PPTX
Farhana shaikh webinar_dictionaries
dictionary14 ppt FINAL.pptx
2 UNIT CH3 Dictionaries v1.ppt
Lecture-6.pdf
"Python Dictionary: The Key to Efficient Data Storage, Manipulation, and Vers...
Dictionary in python
Chapter 16 Dictionaries
DICTIONARIES TUTORIALS FOR ADVANCED LEARNING OF YTHON PROGRAMMING
ch 13 Dictionaries2.pptx
Dictionarys in python programming language.ppt
Unit4-Basic Concepts and methods of Dictionary.pptx
python dictionaries available in python language
Chapter 14 Dictionary.pptx
Dictionariesasdfghjsdfghjklsdfghjkl.pptx
DICTIONARIES (1).pptx
Python programming –part 7
Meaning of Dictionary in python language
Ch_13_Dictionary.pptx
STRING LIST TUPLE DICTIONARY FILE.pdf
Farhana shaikh webinar_dictionaries
Ad

Recently uploaded (20)

PPTX
Unit 4 Skeletal System.ppt.pptxopresentatiom
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PDF
1_English_Language_Set_2.pdf probationary
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
Hazard Identification & Risk Assessment .pdf
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
advance database management system book.pdf
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
Indian roads congress 037 - 2012 Flexible pavement
PDF
RMMM.pdf make it easy to upload and study
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PDF
Trump Administration's workforce development strategy
PPTX
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
PPTX
Cell Types and Its function , kingdom of life
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PPTX
UNIT III MENTAL HEALTH NURSING ASSESSMENT
PDF
What if we spent less time fighting change, and more time building what’s rig...
Unit 4 Skeletal System.ppt.pptxopresentatiom
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
1_English_Language_Set_2.pdf probationary
History, Philosophy and sociology of education (1).pptx
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
Chinmaya Tiranga quiz Grand Finale.pdf
Hazard Identification & Risk Assessment .pdf
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
LDMMIA Reiki Yoga Finals Review Spring Summer
advance database management system book.pdf
Weekly quiz Compilation Jan -July 25.pdf
Indian roads congress 037 - 2012 Flexible pavement
RMMM.pdf make it easy to upload and study
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
Trump Administration's workforce development strategy
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
Cell Types and Its function , kingdom of life
202450812 BayCHI UCSC-SV 20250812 v17.pptx
UNIT III MENTAL HEALTH NURSING ASSESSMENT
What if we spent less time fighting change, and more time building what’s rig...

CBSE Python Dictionary Assignment

  • 1. 1 CHAPTER: DICTIONARY IN PYTHON ASSIGNMENT SET – 1 Time: 30 min M.M. – 20 Instructions:  All Questions are compulsory  Q1 to Q6 carry 1 mark  Q7 to Q10 carry 2 marks  Q11 to Q12 carry 3 marks Q1. Keys must be ______ in dictionary.(mutable/immutable) Q2. Write a built in function which is used to create an empty dictionary. Q3. Write the code to print only keys of the following dictionary. D = {“Amit” : 40, “Sunil” : 34, “Naina” : 30} Q4. Write the code to add the following detail in dictionary given above. “Ravi” – 45 Q5. Write the output of the following code: D = {“Amit” : 40, “Sunil” : 34, “Naina” : 30} print(D[‘Amit’] + D[‘Sunil’]) Q6. Name the function which is used to return a value of the given key. Q7. Write two differences between List and Dictionary.
  • 2. 2 Q8. Write the output of the following: m = {1 : "Jan", 2 : 'Jun', 3 : 'Aug'} print(m[1]) print(m["jan"]) Q9. Explain keys() function of dictionary with example. Q10. Write one similarity and one difference between del statement and pop() function in reference to dictionary. Q11. Find errors in the following statement and write the correct code: num = {1 : 10, 2 : 20, 3 : 30, 4 : 40, 5 : 50} a) print(num.item()) b) print(num.len()) c) print(pop(5)) Q12. Write a program to input details of five employees in a dictionary like employee number, employee name, employee salary and display their details in tabular form.