Professional Documents
Culture Documents
Q.10 How is del DICT different from del DICT[key] if DICT is a dictionary in Python?
OR
How is the clear( ) function different from del <Dictionary> in Python?
Q.15 Read the code below and write appropriate code of given Questions.
L1=[10,20,30]
L2=["Sunday","Monday","Tuesday]
(A) Write python code to add the last element of list L2, at end of list L1.
(B) Insert the first element of list L1, at the beginning of list L2.
Q.16 Tuples in Python are immutable. Write code to prove the statement.
Q.17 Create a dictionary in python whose keys are “name of months” and values are “No. of days” in
corresponding Month.
OR
Create a dictionary in python whose keys are “First Alphabet of day name” and values are “name of day”.
Q.18 Following program is for creating a duplicate dictionary of dictionary “org”. Fill the blank statements so
that the desired task can be achieved.
org={ 'Python' : '.py', 'Word' : '.docx', 'Power Point' : '.pptx' }
print("Original=",org)
dup={}
for key, value in ………..…( ):
dup[.…...]=…………..
print("Duplicate=",dup)
SECTION-C (Q. 19 To 22 : Each of 3 Mark)
Q.19 Explain the following Python List methods with suitable examples.
(A) append( ) (B) extend( ) (C) insert( )
OR
Explain the following methods in reference to Python List with suitable examples.
(A) pop( ) (B) remove( ) (C) clear( )
Q. 21 Aditi is a student of class XI, she works with Python Tuple named SCHOOL and wants to perform
following tasks. Write codes to help Aditi so that she can achieve the desired result.
(A) Find Maximum element in Tuple (B) Check whether Tuple is Empty or Not
(C) Delete the Tuple from memory
Q.22 Mr. Sumit wants to merge the elements of List1 and List2 into List3. He also wants to arrange the
elements in ascending order in List3. He missed some concepts and left the blank line in the program. Read
the code written by Sumit and give answers of questions (A), (B) and (C) to complete the program.
List1=[50,20,45,97,65,16]
List2=[15,10,50,35,90]
List3=[ ]
For num in List1:
List3. _____________ # Statement-1
List3. ___________________ # Statement-2
print("List1: ",List1)
print("List2: ",List2)
print("List3 before sorting: ",List3)
List3. ____________________ # Statement-3
print("List3 After Sorting: ",List3)
(A) Statement-1: to add the elements “from List1” to “at the end of List3”, one by one.
(B) Statement-2: to add all the elements “from List2” to “at the end of List3” in one go.
(C) Statement-3: for arranging the elements of List3 in ascending order.