Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
33%
(3)
33% found this document useful (3 votes)
4K views
Preeti Arora Dictionary Questions
Informatics Practices Class XIth Dictionary Chapter Questions
Uploaded by
Ghanshyam Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Preeti Arora Dictionary Questions For Later
Download
Save
Save Preeti Arora Dictionary Questions For Later
33%
33% found this document useful, undefined
67%
, undefined
Embed
Share
Print
Report
33%
(3)
33% found this document useful (3 votes)
4K views
Preeti Arora Dictionary Questions
Informatics Practices Class XIth Dictionary Chapter Questions
Uploaded by
Ghanshyam Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Preeti Arora Dictionary Questions For Later
Carousel Previous
Carousel Next
Save
Save Preeti Arora Dictionary Questions For Later
33%
33% found this document useful, undefined
67%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 6
Search
Fullscreen
F le ee eee Se eee ooo ANSWERS TO FILL IN THE BLANKS $$$ 1. mutable 2. mapping 3 eerie oat 4. comma 5. colon (:) 6. keyl) 7. unique 8, del; pop() SOLVED QUESTIONS ——_——— ‘4, What is a dictionary? Ans. A Python dictionary isa mapping of unique keys to values. tis collection of key-value pairs. Dietionaries aregtable which means they eon he Canaed_ 2. How are objects stored in dictionaries different? {HOTS} Ans, The objects or values stored in a dictionary can be of any data type (even the type NONE), but keys can be immutable type-objecs. Eg, strings, integers, et 3. Can sequence operations such as slicing and concatenation be applied to dictionaries? Why? [HOTS] ‘Ans. No, sequence operations such a slicing and concatenation cannot be applied to dictionaries as dictionary is not a sequence. Since it is not maintained in any specific order, operations that depend on a specific order cannot be used, 4. Why can’t lists can be used as keys? [HOTS] Ans. lists cannot be used as keys ina dictionary because they are mutable. And a python dictionary can have ‘only keys of immutable types. 5. If the addition of a new key-value pair causes the size of the dictionary to grow beyond its original size, it shall result in an error. True or false? [HOTS] ‘Ans. Faise. No error shall occur because dictionaries are mutable in nature, they can grow or shrink as and when required. 6. What are the differences between lists and dictionary? Ans. Thedifferencesbetween dietionary and stare that i ists, elementsare enclosed within square bracket whereas in dictionary, key-value pairs are enclosed within curly braces. In dictionary, index value aa of any data type and is called key, but in list, index value is an integer. (Ain eon snrine em nd eee ser crac efoloig a ar-aier(') white icon: a=input ("Enter nane:") beinput ("Enter age:") ; al gg=b isin 1 =d1.key() for i in 1: print (i,'\t',*dl(i)*) i neint (input ("Enter number of entrie while i acinput ("Enter name:") beinput ("Enter age aifal=! isin 1=di.keys 0. for 1 inl: print (i, "\t",d1 (iJ) 'aie aot 8, Write the output of the following codes: (a) >>>dl=(1:10, 2:20, 3:30,4:40,5:50) >>>dl. items () >>pdl keys () >>>dl values () {b) di=(1:10,2:20,3:30, 4:40} d2={5:50, 6:60, 7:70) dl -upaate (d2) print (dl) {c) d=(1:10, 2:20, 3:30, 4:40, 5:50, 6:60, 7:70} del d1[3] print (dl) (a) >>>dl=(1:10, 2:20, 3:30, 4:40, 5:50, 6:60, 7:70) >>>dl_.pop (5) >>>print (dl) (e) >>>a1=(1:10,2:20,3:30,4:40, 5250, 6:60,7:70) Clattog Bown >>>len (dl) >>>dl get (6, 60) >>pdl [61-65 >>odl (8]=35 >>>print (dl) perdi clear () >>>print (dl) Ans. (a) dict_items{ (1, 10), (2, 20), (3, 30), (4, 40), (5, 50)1 dict_keys(1, 2,3, 4, 5] dict_values (10, 20, 30, 40, 50) (b) (1: 10, 2: 20, 3: 30, 4: 40, 5: 50, 6: 60, 7: 70) (c) (1: 10, 2: 20, 4: 40, 5: 50, 6: 60, 7: 70) (a) 50 (1: 10, 2: 20, 3: 30, 4: 40, 6: 60, 7: 70) 7 60 (1: 10, 2: 20, 3: 30, 4: 40, 5: 50, 6: 65, 7: 70, B: 35} 0 9. Write a Python program to input ‘n’ names and phone numbers to store it in a dictionary and print the phone number of a particular name. phone=dict () isl neint (input ("Enter number of entries:")) while isso nput ("Enter Name:") nput ("Enter Phone n phone (a}=b isin 1 = phone. keys () x=input ("Enter name to be searched:") for i in 1: if ix print (x,": phone no is:",phone(i]) break else: print(x, "does not exist” ") WAns. Output: Enter number of entries:4 Enter Name:Riya Enter Phone no: 9999 Enter Name:Aman Enter Phone no:1111 Enter Name: Pulkit Enter Phone no:5555 Enter Name: Ziya Enter Phone no:2222 Enter name to be searched Anan Aman : phone no is: 1111 2 Python program to input names of ‘n’ employees and their salary details like basic salary, house rent and conveyance allowance. Calculate total salary of exch employee and dis nsint (input ("Enter number of entries:")) a while ic-n: 4 mput ("\nEnter name of the employee: *) nt (input ("Enter Basic salary: ")) 7 nt (input ("Enter house rent allowance: ")) casint (input ("Enter conveya: oh) i [Nn] =[basic, hra, ca] isin 1 = dl-keys() print ("\nName", *\t\t', "Net for iini: salary z= dl [il : for j inz: salary=salary+j print (i, '\t\t",salary) Output: Enter number of entries: Enter name of the employe: Enter Basic salary: 100000 Enter house rent allowance: 30000 Enter conveyance allowance: 5000 Note: list is stored in dictionary as value. : Nishant Enter name of the employee: Ram Enter Basic salary: 50000 Enter house rent allowance: 15000 = Enter conveyance allowance: 5000 Enter name of the employee: Aushim Enter Basic salary: 200000 Enter house rent allowance: 50000 Enter conveyance allowance: 10000 Enter name of the employee: Riya ‘ Enter Basic salary: 25000 zi | Enter house rent allowance: 2000 yu Enter conveyance allowance: 1000 | 1 | SWName, Net Sulury Nishant 135000 Ram 70000 Aushim 260000 Riya 28000 : i itina 111, Write a Python program to input names of 'n’ countries and their capital and currency, store dictionary and display in tabular form, Also search and display for a particular country. Ans, di=dict () ind neint (input ("Enter number of entries while icen: ei ll ee c=input ("Enter Country ‘ | capeanpue enter capitals") { curreinput ("Enter currency of country") ( ai {el=(cap, curr] Holding the country details as a list { Le ie 1 = dl keys () { print ("\nCountry\e\t", "Capital\e\e", "currency") ‘ fore inl: { zed [i] print ("\n',i, "\t\t! ends for j ina: print (j,'\t\t',end="\t\t") # searching ie es x=input ("\nBnter Country to be searched: ") ie . for iin: ' if i-ex: print ("\nCountry\t\t", "Capital\t\t", "Currency\t\t") ‘ zed1 lil i print (*\n', i, "\e\t', enc for j ina: print (j,*\t\t',end="\t\t") Output: Enter number of entries:5 z Fnter Country:Austria Enter Capital: Vienna Enter currency of country:Suro Enter Country:China : Enter Capital:Beijing | Enter currency of country:Yuan : Enter Country: India : i Enter Capital:New Delhi Enter currency of country: Indian Rupee Enter Country: France Enter Capital:Paris Enter currency of country:Euro Enter Country:United Kingdom Enter Capital:London Enter currency of country:Pound arc euCountry capital currency Austria Vienna Euro china Beijing Yuan ? India New Delhi Indian Rupee France Paris Euro United Kingdom London Pound Enter Country to be searched: India country capital Currency India New Delhi Indian Rupee 22. Write a program to find number of occurrences of each letter present in the given string. Ans, word = input ("Enter any word: ") dso for i in word: ALi] = d.get (i,0)41 for k,v in d.items() : print (k, "occured", v, "times") Output: Enter any word: nitinhello n occured 2 times i occured 2 times t occured 1 times h occured 1 times ¢ occured 1 times 1 occured 2 times © occured 1 times 13. ite a program to find number of occurrences of each vowel present in the inputted string. Ans. word = input ("Enter the string : ") vowels = {ta','e!, 1it,'o!, 'u") . a=0 for i in word: if i in-vowels: Ii] = d.get (i,0) +2 for k,v in sorted(d.items()): print (k, "occured", v, "times") Output: Enter the string: Pythonprogramming a occured 1 times i occured 1 times © occured 2 times UNSOLVED QUES TIONS == 11, What is a key-value pair in dictionary? 2. What are the differences between strings and dictionary? 3, Find errors and rewrite the same after correcting the following code: (a) di=(1:10,2.5:20,3:30, 4:40,5:50,6:60,7/70}, (b) di.(9)=90 (e) del di (2) : (4) pop dita] {e) di.iteni() ry (A dlkey() (g) di.value() ; (h) dl.gets (4,80) () di.tenQ 1 @ di.clears()4. Suppose peedi=(1:'one',2:'two', 3 ‘three’, 4:'four') >>>d2=(5:"£ive',6:" six') Write the output of the following code: (a) >>>al. items () >>>dl keys () >>>dl.values () >>>d1 update (d2) >>>len (dl) (b) >>>de1 an {3} >>>print (dl) >>>dl pop (4) >>>print (dl) >>>dl [8] ="eight! >>>print (dl) >e>dl.clear() >>>print (dl) 5. Write a Python program to input display the same. Also accept a of that class, ‘n’ classes and names of their class teachers to store it in a dictionary and Particular class from the user and display the name of the class teacher 6. Write a program to store student names and their Percentage ina dictionary, delete a particular student ‘name from the dictionary Y. Also display dictionary after deletion. 7. Write a Python program to input names of ‘n’ cust fomers and their details like items bought, cost and phone number, store it in a dictionary and display all the details in a tabular form, 8. What type of objects can be used as keys in dictionaries? 9. Can you check from a value inside 3 dictiona FY Using in operator? How will you check for a value i dictionary using in operator? 10, How is clear() function different from del() statement? 11, The following code is giving some error. Find out the error and write the corrected code aL = ("ams1, Lia", (1, "a") two") 12. What will be the output of the following code: dl = (5: [6,7,8], "a": (1,2,3)} print (dl. keys ()) print (dl.values ()) 13, Predict the output: (a) d= ((1,2)21, (2,3) 22) print (d[1,2]) () d= {tated tb print (d{'a’, 'b')) 14, Write a program that asks the user to enter product names and whose keys are the product names and whose values are the products and prices, allow them to repeatedly enter a or message if the product is notin the dictionary, Prices. Store all of these in a dictionary prices. When the user is done entering product name and print the corresponding price 15. Write a Python program that accepts a value and checks whether the in dictionary or not. Ifit is present, check for the frequen key otherwise print an error message. putted value is part of given cy ofits occurrence and print the corresponding ne 0 OBB 28 8282842 AAS
You might also like
Set of 15 Sample Papers With Solutions & Blueprint For Class 12 Computer Science, 2024-25 Exam Edition
PDF
No ratings yet
Set of 15 Sample Papers With Solutions & Blueprint For Class 12 Computer Science, 2024-25 Exam Edition
163 pages
Solution Revision Tour Worksheet PDF
PDF
100% (3)
Solution Revision Tour Worksheet PDF
10 pages
11computer Science-Python Fundamentals-Assignment
PDF
100% (1)
11computer Science-Python Fundamentals-Assignment
2 pages
MYSQL Assignments Final PDF
PDF
No ratings yet
MYSQL Assignments Final PDF
1 page
BCA 301 Solutions
PDF
No ratings yet
BCA 301 Solutions
12 pages
E-Commerce MCQ INFOTECH 200 Questions PDF
PDF
76% (41)
E-Commerce MCQ INFOTECH 200 Questions PDF
26 pages
Ip Exam 2
PDF
No ratings yet
Ip Exam 2
2 pages
Question Bank Class Xi Ip To Be Uploaded
PDF
No ratings yet
Question Bank Class Xi Ip To Be Uploaded
19 pages
Sample20Paper20120Class20XI20Annual20Exam20CS PDF
PDF
No ratings yet
Sample20Paper20120Class20XI20Annual20Exam20CS PDF
7 pages
Question Bank Class Xi Cs-4
PDF
No ratings yet
Question Bank Class Xi Cs-4
20 pages
Cs (File Handling) Important
PDF
No ratings yet
Cs (File Handling) Important
12 pages
CSV Files
PDF
No ratings yet
CSV Files
14 pages
Computer Science
PDF
100% (1)
Computer Science
93 pages
Art Integrated Project Computer Science
PDF
No ratings yet
Art Integrated Project Computer Science
15 pages
CS Project Class 11th Python Programs
PDF
No ratings yet
CS Project Class 11th Python Programs
27 pages
Rewrite The Following Code Fragment That Saves On The Number of Comparisons
PDF
No ratings yet
Rewrite The Following Code Fragment That Saves On The Number of Comparisons
18 pages
Strings Class 11
PDF
No ratings yet
Strings Class 11
18 pages
File Handling
PDF
No ratings yet
File Handling
12 pages
Class-12 File Handling Question and Answer
PDF
No ratings yet
Class-12 File Handling Question and Answer
19 pages
Class Xii Minimum Level Learning
PDF
No ratings yet
Class Xii Minimum Level Learning
10 pages
11th Dictionary Type B Sumita Arora
PDF
100% (1)
11th Dictionary Type B Sumita Arora
15 pages
Grade 12 CS Practice Material 2023-24
PDF
No ratings yet
Grade 12 CS Practice Material 2023-24
217 pages
GG Class XII CS
PDF
No ratings yet
GG Class XII CS
24 pages
Binary File Exam Based Questions
PDF
100% (1)
Binary File Exam Based Questions
10 pages
ComputerScience-SQP Set5-MS
PDF
No ratings yet
ComputerScience-SQP Set5-MS
13 pages
Class Xii Computer Science (Question Bank - MLL)
PDF
No ratings yet
Class Xii Computer Science (Question Bank - MLL)
40 pages
Python Revision Tour - Solutions of Computer Science With Python by Sumita Arora For Class 12 CBSE & NCERT - KnowledgeBoat
PDF
No ratings yet
Python Revision Tour - Solutions of Computer Science With Python by Sumita Arora For Class 12 CBSE & NCERT - KnowledgeBoat
44 pages
11computer Science-List, Tuple and Dictionaries-Notes
PDF
No ratings yet
11computer Science-List, Tuple and Dictionaries-Notes
13 pages
Class 12th - QuestionBank - ComputerScience
PDF
No ratings yet
Class 12th - QuestionBank - ComputerScience
184 pages
Class XI Sample Exam Paper CS
PDF
100% (1)
Class XI Sample Exam Paper CS
7 pages
SAMPLE QUESTION PAPER 1 (Solved)
PDF
100% (1)
SAMPLE QUESTION PAPER 1 (Solved)
8 pages
XII CS PB-I Sample Paper-IV by KVS RO Kolkatta
PDF
No ratings yet
XII CS PB-I Sample Paper-IV by KVS RO Kolkatta
11 pages
Xii Cs SQP Practice 1
PDF
No ratings yet
Xii Cs SQP Practice 1
92 pages
1 What Will Be The Output of Following Code-: A (1:"A",2:"B",3:"C") Foriina: Print (I, End " ")
PDF
100% (1)
1 What Will Be The Output of Following Code-: A (1:"A",2:"B",3:"C") Foriina: Print (I, End " ")
15 pages
Function Practice Questions
PDF
No ratings yet
Function Practice Questions
16 pages
Python Viva Questions For Class 12 Important For Practical Exam
PDF
100% (1)
Python Viva Questions For Class 12 Important For Practical Exam
7 pages
CS CLASS 12 Case Study 01
PDF
No ratings yet
CS CLASS 12 Case Study 01
6 pages
CS12 CH 5 Python File Handling
PDF
0% (4)
CS12 CH 5 Python File Handling
6 pages
ComputerScience SQP Set2 MS
PDF
No ratings yet
ComputerScience SQP Set2 MS
12 pages
Python Strings - Notes - Class Xi
PDF
No ratings yet
Python Strings - Notes - Class Xi
5 pages
Working With Functions Sumita Arora MCQ
PDF
67% (3)
Working With Functions Sumita Arora MCQ
7 pages
Sample Paper 3 Class XI Annual Exam CS
PDF
No ratings yet
Sample Paper 3 Class XI Annual Exam CS
7 pages
XII - Comp. Scioence
PDF
0% (1)
XII - Comp. Scioence
175 pages
Project Template Computer Science by Swati Chawla
PDF
100% (1)
Project Template Computer Science by Swati Chawla
10 pages
Class 12 CBSE MySQL Computer Science Worksheet
PDF
0% (1)
Class 12 CBSE MySQL Computer Science Worksheet
3 pages
Grade 12 Python Practical Questions With Solutions
PDF
No ratings yet
Grade 12 Python Practical Questions With Solutions
18 pages
Class XI Computer Science Holiday H
PDF
No ratings yet
Class XI Computer Science Holiday H
11 pages
Informatics Practices Class 11th Notes Unit 3 Part-1 MySql
PDF
No ratings yet
Informatics Practices Class 11th Notes Unit 3 Part-1 MySql
9 pages
12 Practical File 2024-25
PDF
No ratings yet
12 Practical File 2024-25
45 pages
CS - String Manipulation in Python
PDF
No ratings yet
CS - String Manipulation in Python
10 pages
CBSE Class 12 Computer Science Compartment Answer Key
PDF
No ratings yet
CBSE Class 12 Computer Science Compartment Answer Key
24 pages
CS Prctical File Class XI
PDF
100% (2)
CS Prctical File Class XI
31 pages
CS Practical File
PDF
No ratings yet
CS Practical File
20 pages
Viva Questions Class 12
PDF
No ratings yet
Viva Questions Class 12
28 pages
Xiiip Practical 2023-24 - Final
PDF
0% (1)
Xiiip Practical 2023-24 - Final
38 pages
Class 12 - COMPUTER NETWORKS - Important Case Questions
PDF
0% (1)
Class 12 - COMPUTER NETWORKS - Important Case Questions
10 pages
XII IP Practical File 1 Complete
PDF
No ratings yet
XII IP Practical File 1 Complete
38 pages
Data File Handling Application Based Questions Answers
PDF
No ratings yet
Data File Handling Application Based Questions Answers
2 pages
imp CBSE Class 12 Computer Science Practical Viva Q Python 2024-2025
PDF
0% (1)
imp CBSE Class 12 Computer Science Practical Viva Q Python 2024-2025
2 pages
Class 12 CS Revision Tour MCQ
PDF
100% (1)
Class 12 CS Revision Tour MCQ
5 pages
Dictionary and Tuples
PDF
No ratings yet
Dictionary and Tuples
6 pages
Dictionary
PDF
No ratings yet
Dictionary
7 pages
dictionaries in python
PDF
No ratings yet
dictionaries in python
26 pages
Preeti Arora List Questions
PDF
67% (3)
Preeti Arora List Questions
8 pages
Mysql Assignment - 1: Where Quality Matters
PDF
No ratings yet
Mysql Assignment - 1: Where Quality Matters
1 page
Mysql Assignment - 2: Where Quality Matters
PDF
No ratings yet
Mysql Assignment - 2: Where Quality Matters
1 page
Mysql Assignment - 15: Where Quality Matters
PDF
No ratings yet
Mysql Assignment - 15: Where Quality Matters
1 page
Python Primer: Patrice Koehl Modified by Xin Liu in Apr., 2011
PDF
No ratings yet
Python Primer: Patrice Koehl Modified by Xin Liu in Apr., 2011
33 pages
Xith Ip Mysql Part
PDF
No ratings yet
Xith Ip Mysql Part
13 pages
Joining Notes New
PDF
No ratings yet
Joining Notes New
8 pages
Payment Status: Thank You Your Payment Is Successful
PDF
No ratings yet
Payment Status: Thank You Your Payment Is Successful
1 page
G 083 19 LIC Sales Brochure Jeevan Amar Hindi Proof 12
PDF
No ratings yet
G 083 19 LIC Sales Brochure Jeevan Amar Hindi Proof 12
2 pages
View / Download Account Statement: Savings Account No.: 50100021996040, CYBERCITY
PDF
No ratings yet
View / Download Account Statement: Savings Account No.: 50100021996040, CYBERCITY
2 pages
XIth IP Python
PDF
No ratings yet
XIth IP Python
17 pages
Web Technology Brochure
PDF
No ratings yet
Web Technology Brochure
11 pages
© Educational Technology Department, Group Head Office, The City School. 1
PDF
No ratings yet
© Educational Technology Department, Group Head Office, The City School. 1
13 pages
PHP Basic String Functions
PDF
No ratings yet
PHP Basic String Functions
1 page
Application Development: 14 Years Experience in Websites & Applications Development
PDF
No ratings yet
Application Development: 14 Years Experience in Websites & Applications Development
12 pages
One Columns Css File
PDF
No ratings yet
One Columns Css File
29 pages
A 6 R 4
PDF
No ratings yet
A 6 R 4
2 pages
We Can Create Dictionary With Following Four Methods
PDF
No ratings yet
We Can Create Dictionary With Following Four Methods
4 pages
Class Xi Guess Paper Informatics Practices: General Instructions: MM: 70
PDF
No ratings yet
Class Xi Guess Paper Informatics Practices: General Instructions: MM: 70
8 pages
Excel Notes
PDF
No ratings yet
Excel Notes
22 pages
MBA IT 108 Solutions
PDF
No ratings yet
MBA IT 108 Solutions
10 pages
(Informatics Assistant) : Study Material
PDF
No ratings yet
(Informatics Assistant) : Study Material
18 pages
Project Report: Bachelor of Computer Application
PDF
No ratings yet
Project Report: Bachelor of Computer Application
78 pages