## TN State Board 12th Computer Science Important Questions Chapter 9 Lists, Tuples, Sets and Dictionary

Question 1.
What is known as Nested list?
A list contains within another list as an element. This type of list is known as Nested list.

Question 2.
What is known as index value in python?
(i) In python, index value is an integer number which can be positive or negative.
(ii) Positive value of index counts from the beginning of the list and negative value means counting backward from end of the list. Question 3.
What is the output?
>>>marks = [10, 20, 30, 40]
>>> marks 1 = [100, 200, 300,400]
>>> print (marks )
>>> print (marks 1 [-1])
Output:
10
400

Question 4.
What is the output?
>>> Name = [‘Anand’, ‘Arul’, ‘Nithya’,
‘Vani’]
>>> print (Name )
>>> print (Name [-2])
Output:
Arul
Nithya

Question 5.
What is the use of index from and index to?

• Index from is the beginning index of the range.
• Index to is the upper limit of the range which is excluded in the range. Question 6.
What is difference between append ( ) and extend ( )?

• append ( ) function is used to add single element in a list.
• extend ( ) function is used to add more than one element to an existing list.

Question 7.
What is difference between append ( ) and insert ()?

• Append () function is used to add more elements, but it includes elements at the end of list.
• Insert ( ) function is used to insert an element at any position of a list.

Question 8.
What is the use of pop ( ) and clear ( ) function?
pop ( ) function deletes and returns the last element of a list if the index is not given.
Clear ( ) function is used to delete all the elements in list, it delete only the elements and retains the list.

Question 9.
What is the output?
for x in range (3, 12, 3)
print, (x)
Output:
3
6
9 Question 10.
What is Tuples in python?

• Tuples is similar to list, tuples consists of a number of values separated by comma and enclosed within parenthesis.
• In a tuple values cannot be changed in the lists.

Question 11.
What is tuple () function?
The tuple () function is used to create Tuples from a list. When you create a tuple, from a list, the elements should be enclosed within square brackets.

Question 12. What is called singleton tuple?
(i) While creating a tuple with a single element, add a comma (,) at the end of the element.
(ii) In the absence of a comma, python will consider the element as an ordinary data type. Creating a Tuple with one element is called singleton Tuple.

Question 13.
What is Tuple assignment?

• Tuple assignment is a powerful feature in python.
• It allows a tuple variable on the left of the assignment operator to be assigned to the values on the right side of the assignment operator.
• Each value is assigned to its respective variable.

Question 14.
How can you creating a set?

• A set is created by placing all the element separated by comma within pair of curly brackets.
• The set ( ) function can also used to create sets in python.

Question 15.
What are the set operator supports in python?
There are four types of set operations supports in python.

They are union (|), Intersection (&), Difference(-) and symmetric difference (A). Question 16.
What is known as Dictionaries?
A dictionary is a mixed collection of elements. The keys in a python dictionary is separated by a colon (:) while the commas work as a separator for the elements. The key value pairs are enclosed with curly braces {}.

Question 17.
What is output?
Diet = {x:3*x for x in range (2,3)}
print (Diet)
Output:
{2:9,3:9}

Question 18.
What is mean by modification of a value in dictionary?
(i) Modification of a value in dictionary is very similar as adding elements.
(ii) When you assign a value to a key, it will simply overwrite the old value.

Question 19.
What is output?
Marks = {10, 23, 41, 75}
i=-1
while i> = -4:
print (marks[i])
i = i + -1
Output:
75
41
23
10

Question 20.
What is output?
>>>Name = [“Arun”, “Senthil”, “Kumar”]
>>> len(Name)
Output:
3

Question 21.
What is output?
for x in range (2,11,2)
print (x)
Output:
2
4
6
8
10 Question 22.
What is output?
>>> sQuestion = [x**2 for x in range (1,6)]
>>> print (sq)
Output:
[1, 4, 9, 16, 25]

Question 23.
What is output?
>> (x, y, z, p) = (2**2, 5/3+4,15%2, 34>65)
>>> print (x,y,z,p)
Output:
45.666666666666667 1 False

Question 24.
How can you create a list in python?
Python, a list is simply created by using square bracket.
The element of list should be specified within square brackets.
The syntax is variable = [element-1, element-2, element-3 element -n]
Eg: class = [“RAJA”, “RANI”, 50,100]

Question 25.
Write a python program to print reverse indexing.
Marks = [5, 25, 10, 50, 35]
i = -1
while i >= -5
print (marks [i])
i=i+-1
Output:
35
50
10
25
5 Question 26.
Write a short note on List Length in python?
The len ( ) function in python is used to find the length of a list. The len ( ) function is used to set the upper limit in a loop to read all the elements of a list. If a list contains another list as an element, len ( ) function returns that inner list as a single element.
Eg; . s .
>>>Item = [“soap”, “pen”, “INK”]
>>>len (Item)
Output is 3.

Question 27.
Write short note on list comprehensions.
List comprehensions is a simplest way of creating sequence of elements that satisfy a certain condition.
The syntax is List = [expression for variable in range]
Eg:
>>>cubes = [x**3 for x in range (1,6)]
>>>print(cubes)
Output:
1 8 16 32 64
In this example x**3 in the expression is evaluated each time it is iterated. This is the shortcut method of generating series of values.

Question 28.
Write a program to define a list of cities that are metro in India or not.
# program for metro city or not
city = [“CHENNAI”, “DELHI”, “MUMBAI”, “KOLKATTA”]
Metro_city = input “Type name of the city”) if metro_city in city:
print (metro_city, “is the metro city in India”) else: ‘
print (metro_city,“is no the *metro city in India”)

Question 29.
Write a program to find the area and circumference of the circle using function with tuple assignment.
pi = 22/7
def circle (r):
return (pi * r*r, 2*pi*r)
print (“Area of the circle =”, area)
print (“Circumference of the circle-’, circum) Question 30.
Write a program to swap two values using tuples assignment.
a = int(input(“Enter value of A:”))
b = int (input(“Enter value of B:”))
print(“Value of A =”, a, “\n Value of B=”,b) (a,b) = (b,a)
print(“Value of A =”,a,”\n value of B =”,b)
Output:
Enter value of A: 54
Enter value of B: 38
Value of A= 54
Value of B = 38
Value of A= 38
Value of B = 54

Question 31.
Write a program to print positive numbers from the list.
Numbers = (5,-8,6,8,-4, 3, 1)
Positive = ( )
for i in Numbers:
if i > 0:
positive +=(i,)
print(“Positive Numbers: “, Positive)
Output:
Positive Numbers: (5, 6, 8, 3, 1)

Question 32.
What is output?
set_A = {‘A’, 2,4/D’}
set_ B = {‘A’/B’/C’/D’}
print (set A A set B)
output:
{2, 4,’B’, C’} Question 33.
Explain copy (), count (), sum () functions.
(i) Copy ( ) – is used returns the copy of the list.
The syntax is list.copy ()
Eg: orilist = [10,20, 30]
x = orilist. copy ()
print (x)
Output [10,20, 30]

(ii) Count () – is used to returns the number of similar elements present in last.
The syntax is list count (value)
Eg: orilist = [10, 20, 30]
x = orilist.count (30)
Output 2

(iii) Sum ( ) – is used returns the sum of values in a list
The syntax is sum (list)
Eg:
orilist = [10, 20, 30]
print (sum(orilist))
Output 60

Question 34.
Write a program that create a list of numbers upto 50 that are divisible by 5.
# program for divisible by 5
divby5 = [ ]
for i in range (51):
if (i % 5 =0):
divby5.append (i)
print (divby5)
output [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50]

Question 35.
Write a program to read six subject marks and print the total marks.
# program for six subjects with Total marks
marks = [ ]
subjects = [“Tamil”, “English”, “physics”, “chemistry”, “maths”, “comp.Science”]
for i in range (6):
m = int (input(“Type mark”))
marks.append (m)
for j in range (len(marks)):
print (“{}.{} mark ={}”. format (j1+, subjects!]], marks[j]))
print (“Total marks”, sum (marks)) Question 36.
Write a program to delete all the even numbers from the list.
# program for delete all the even numbers
Num=[ ]
for x in range (1, 11):
Num.append (x)
print (“the numbers from 1 to 10 =”, Num)
for index, i in enumerate (Num):
if (i %2 = = 0):
delNum [index]
print (“The list after deletingeven numbers”,
Num)

Question 37.
Write a program that generate a set of prime numbers another set of even numbers.
Demonstrate the result of union, intersection, difference and symmetric difference operations.
even=set([x*2 for x in range(l, 11)])
primes=set( )
for i in range(2, 20):
j=2
f=0
while j<i/2:
if i%j==0
f=1
j+=1
if f==0
print(“Even Numbers: even)
print(“Prime Numbers: “, primes)
print(“Union: even.union(primes))
print(“Intersection:”, even. intersection(primes))
print(“Difference: even.difference(primes))
print(“Symmetric Difference: even.
symmetric_difference(primes))
Output:
Even Numbers: {2, 4, 6, 8, 10, 12, 14, 16, 18, 20}
Prime Numbers: {2, 3, 4, 5, 7, 11, 13, 17, 19}
Union: {2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20}
Intersection: {2, 4}
Difference: {6, 8,10, 12, 14, 16, 18, 20}
Symmetric Difference: {3, 5, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20} Question 38.
What is List in Python?
List is an ordered collection of values enclosed within square brackets [ ]. A list in python is known as a sequence data types like string. Each value of a list is called as element. It can be of any type such as numbers, characters, strings and even the nested lists.

Question 39.
How will you access the list elements in reverse order?
Python enables reverse or negative indexing for the list elements.The python sets -1 as the index value for the last element in list and -2 for the preceding element and so on. This is called as Reverse order.

Question 40.
What will be the value of x in following python code?
List1=[2,4,6[l,3,5]] x=len( List1)
The output will be printed as
4
Note: Inner list considered as single element in python. Question 41.
Differentiate del with remove( ) function of List.

 Del remove () del statement is used to delete known element. remove () function is used to remove elements of a list if its index is unknown. The del statement can also be used to delete entire list. The remove () function can also be used to delete one or more elements.

Question 42.
Write the syntax of creating a Tuple with n number of elements.
Tuple_Name = tuple ([list of element])
Eg: Prime_Num = tuple ([2, 3, 5, 7, 11])

Question 6.
What is set in Python?
A set is created by placing all the elements separated by comma within a pair of curly brackets.
The set ( ) function can also used to create sets in python.
Eg: >>>s = {1, 2, 3, ‘M’, 56, 100}

Question 43.
What are the advantages of Tuples over a list?
(i) The elements of a list are changeable (mutable) whereas the elements of a tuple are unchangeable (immutable), this is the key difference between tuples and list.
(ii) The elements of a list are enclosed within square brackets. But, the elements of a tuple are enclosed by paranthesis.
(iii) Iterating tuples is faster than list. Question 44.
Write a shot note about sort( ).
Sort( ) function sorts the elements in list.
The syntax is
List.sort(reverse= True|False, key = my func)
• Both arguments are optional.
• Ascending is default.
• If reverse is set as True, list sorting is in descending order.

Question 45.
What will be the output of the following code?
list = [2**x for x in range(5)]
print(list)
1 2 4 8 16

Question 46.
Explain the difference between del( ) and clear( ) in dictionary with an example.

 Del clear ( ) Del statement is used to delete known element. The Clear () function is used to delete all the elements in a dictionary. The del statement can also be used to delete entire list. It deletes only the elements and retains the list. Eg:>>> del name  deletes an element whose index value is 1. Eg;»>Name_list. clear () This example removes only the elements and retain the list in Name_list. Question 47.
List out the set operations supported by python.
In python is supports the set operations such as union, intersection, difference and symmetric difference.
(i) Union – It includes all element from two or more sets. The operator is used to union of two sets.
(ii) Intersection – It includes the common elements in two sets. The operator & is used to intersect two sets in python.
(iii) Difference – It includes all elements that are in first set (set A) but not in the second set (set B). The – (minus) operator is used to difference set operation in python.
(iv) Symmetric difference – It includes all the elements that are in two sets (set A and B) but not the one that are common to two sets. The caret (A) operator is used to symmetric difference set operation in python.

Question 48.
What are the difference between List and Dictionary?

 List Dictionary List is an ordered set of elements. Dictionary is a data structure that is used for matching one element with another. The index value can be used to access a particular element. In dictionary key represents index. Lists are used to look up a value. Dictionary is used to take one value and look up another value. Question 49.
What the different ways to insert an element in a list. Explain with suitable example.
In python, to insert an element in a list for different ways, that are append ( ), extend ( ) and insert ( ) functions.

(i) append ( ) – is used to add a single element. The syntax is
Eg:
>>> Mark list = [90, 95, 98]
>>> Marklist.append (99)
>>> Print (marklist)
The output is [90, 95, 98, 99]
In this example, marklist is created with three elements.
Through >>>marklist.append (99) is that additional value (99) is included with the existing list as last element.

(ii) extend ( ) is used to add more than one element to an existing list.
The syntax is List.extend ([elements to be added])
Eg:
>>>Namelist.extend ([50,60,70])
>>> print (Namelist)
The output is [90, 95, 98, 99, 50, 60, 70]
In this example, extend ( ) function is used to include multiple elements, it shows all the elements of list after the inclusion of additional elements.

(iii) Insert () – is used to insert an element at any position of a list.
The syntax is:
List.insert (position index, element)
Eg:
>>>Namelist = [50, 60, ‘RAJA’, 4OUNA’, ‘YUVA’] *
>>>Namelist.insert (4, ‘SEKAR’)
>>> Print(Namelist)
The output is
[50, 60, ‘RAJA’, ‘GUNA’, ‘SEKAR’, ‘YUVA’]
In this example insert ( ) function a new element ‘sekar’ at the index value. Question 50.
What is the purpose of range( )? Explain with an example.
The range () is a function used to generate a series of values in python.
Using range () function, you can create list with series of values. The range () function has three arguments.
The syntax is
range (start value, end value, step value) Where
start value – beginning value of series. Zero is the default beginning value.
end value – upper limit of series. Python takes the ending value as upper limit -1.
step value – It is optional argument, which is used to generate different interval of values. Eg:
for m in range (5, 50, 5)
print (m)
The output will be printed as 5
10
15 „
20
25
30
35
40
45
In this example, start value 5 and end value is 50 with step size is 5, so it will be printed 5, 10, 15…. Question 51.
What is nested tuple? Explain with an example.
(i) A tuple can be defined inside another tuple is called Nested tuple.
(ii) In a nested tuple, each tuple is considered as an element.
(iii) The for loop will be useful to access all the elements in a nested tuple.
(iv All the functions used in list can be applicable even for tuples.
(v) Tuple is similar to list, values in a list can be changed but not in a tuple.
Eg:
Rankers = ((“ RAJA”, “I”), (“RANI”, “II”), (“LATHA”, “HI”), (“MANI”, “IV”))
for m in Rankers:
print (m)
The output will be printed as
(“RAJA”, “I”)
(“RANI”, “II”)
(“LATHA”, “III”)
(“MANI”, “IV”)

Question 52.
Explain the different set operations supported by python with suitable example.
The python is supports the set operations such as union, intersection, difference and symmetric difference.

(i) Union:
It includes all elements from two or more sets.
The operator | is used to union of two sets. The function union ( ) is also used to join two sets in python. Eg:
set_A={ 10,20}
set_B={‘M’,‘N’}
U set = set _A | set_B
print (U_set)
Output
{10,20,‘M’,‘N’}

(ii) Intersection:
It includes the common elements in two sets.
The operator & is used to intersect two sets in python.
The function intersection ( ) is also used to intersect two sets on python. Eg:
set_A={5,10, ‘Y’}
set_B={‘X’,‘Y’}
print (set_A&set_B)
Output:
{‘Y’}

(iii) Difference:
It includes all elements that are in first set (set A) but not in the second set (set B)
The minus (-) operator is used to difference set operation. The function difference () is used to difference operation. Eg:
set_A={‘A’,2,4,’D’}
set_B={‘A\ ‘B\ ‘C’, ‘D’}
print (set_A-set_B}
Output:
{2,4}

(iv) Symmetric difference:
It includes all the elements that are in two sets (set A and B) but not the one that are common to two sets.
The caret (^) operator is used to symmetric difference set operation. The function symmetric difference () is also used to do the same operation. Eg:
set_A= {‘ A’ ,2,4, ‘ D ’}
print (set_A A set_B)
output:
{2,4,‘B’, ‘C’} Question 53.
Write a program to remove duplicates from a list.
# program to remove duplicates from a list,
n = [10,20,30,20,10,50,60,40,80,50,40]
dupnumber = set ()
uniq_number=[ ]
for x in n:
if x not in dupnumber:
uniq_number.append (x)
print (dup number)

Question 54.
Write a program that prints the maximum value in a Tuple.
# program that prints maximum value in tuple.
tuple l,tuple2 = (‘TAMIL’, ‘ENGLISH’,’ ‘MATHEMATICS’, ‘COMPUTER SCIENCE’), (256, 500, 2720)
print (“The maximum value element”, max (tuple 1))
print (“The maximum value element”, max (tuple2))
The output is
The maximum value element COMPUTER SCIENCE
The maximum value element 2720. Question 55.
Write a program that finds the sum of all the numbers in a Tuples using while loop.
# program for sum of all the numbers in tuples using while loop.
n= int (input (“Type maximum number”))
sum = 0
while (n>0):
sum+=n
n-=1
print (“The sum is”, sum)

Question 56.
Write a program that finds sum of all even numbers in a list.
# program for sum of all even numbers in a list
m = int (input (“Type the maximum value”))
T= 0
for n in range (1, m+1):
if (n % 2 =0):
print (“{0}’’.format (n)/format (n))
T =T+N
print (“The sum Even numbers from 1 to {0}
= {1}”.format (n,t)) Question 57.
Write a program that reverse a list using a loop.
# program that reverse a list using loop.
word_list= [‘RAM’, ‘MAN’, ‘RAJ’,’SUN’]
i = len (word_list)-1
while i>=0:
print (word list [i])
i-=l
Word_list[‘RAM’,(or)‘MAN’, ‘RAJ’, ‘SUN’]
for i in range (len(word_list)-1,-1,-1)
print (wordlist[i])

Question 58.
Write a program to insert a value in a list at the specified location.
# program to insert a value in a list at the specified location
defmain( )
Listl= [‘RAM’, ‘BALU’, ‘CHAN’, ‘WHAT’,‘THAT’]
print (List 1)
list1.insert (3, ‘WHY’)
print(list1)
Listl.insert (0, ‘city’)
print (list1)
List2 = [3, 5, 7,1]
for elem in reversed (list2): //insert all the elements
list1.insert (3, elem)
print (list1)
List1 = list1 [:3]+list2 +listl[3:]
print (list+1)
if name —‘main’ main()
Output:
l.[‘RAM’, ‘BALU’,’CHAN’, ‘WHAT’, ‘THAT’]
2.[‘RAM’, ‘BALU’, ‘CHAN’, ‘WHY’, ‘WHAT’, ‘THAT’]
3.[‘CITY’, ‘RAM’, ‘BALU’, ‘CHAN’, ‘WHY’, ‘WHAT, ‘THAT’]
4.[‘CITY’, ‘RAM’, ‘BALU’, 3,5,7,1, ‘CHAN’, ‘WHAT’, ‘THAT’].
5.[‘RAM’ ‘BALU’, ‘CHAN’, 3,5,7,1, ‘WHAT’, ‘THAT’] Question 59.
Write a program that creates a list of numbers from 1 to 50 that are either divisible by 3 or divisible by 6.
# program for list of numbers from 1 to 50
that are either divisible by 3 or divisible by 6.
for i in range (1, 50+1):
if (i % 3 =0 or i % 6==0):
print (i)

Question 60.
Write a program to create a list of numbers in the range 1 to 20. Then delete all the numbers from the list that are divisible by 3.
# program list numbers from 1 to 20 and delete all from divisible by 3
number_list – (1:20)
print (numberlist)
for i in range (1,20+1):
if (i %3 =0):
del (i) Question 61.
Write a program that counts the number of times a value appears in the list. Use a loop to do the same.
# program counts the number of times a
value appears in the list
1st = [2, 1, 5, 10, 5, 3, 4, 9, 12, 5, 5, 4]
def count (1st, x):
count = 0
for i in 1st:
if (i =x)
count = count+1
return count
x=5
print (countx (1 st, x))
Output: 4

Question 62.
Write a program that prints the maximum and minimum value in a dictionary.
# program maximum and minimum value in a dietionary.
my_dict = {‘x’:500, ‘y’:5000, ‘z’: 8000}.
key_max = max (my_dict.keys( ), key = (lambda k: my_dict[k]))
keyjnin =? min (my_dict.keys( ), key = (lambda k: my dict[k]))
print (‘maximum value’,my_dict [key_max])
print (‘minimum value’ ,my_dict[key_min])
output
maximum value 8000
minimum value 500. Question 1.
What is a position of an element is indexed with starting number?
(a) 0
(b) 1
(c) -1
(d) None
(a) 0

Question 2.
What is used, a list is simply created in python?
(a) ( )
(b) [ ]
(c) {}
(d) All of them
(b) [ ] Question 3.
Which value of index counts from the beginning of the list elements?
(a) Positive
(b) Negative
(c) Both (a) and (b)
(d) None of these
(a) Positive

Question 4.
Which value of index counts backward from end of the list?
(a) Positive
(b) Negative
(c) Both (a) and (b)
(d) None of these
(b) Negative

Question 5.
Which are used to access all elements from a list?
(a) loop
(b) statements
(c) function
(d) none of these
(a) loop Question 6.
What is the range [0 : 5] in python?
(a) 0 to 5
(b) 0 to 4
(c) 1 to 5
(d) 1 to 4
(b) 0 to 4

Question 7.
Which function is used to add a single element to an existing list?
(a) append ( )
(b) extend( )
(d) more( )
(a) append ( )

Question 8.
What happen in the following statement? marks.append (99)
(a) 99 is included with the existing list in mark list.
(b) 99 is added to existing values in mark list.
(c) 99 is removed from existing list in mark list.
(d) 99 is added to the first value of existing list.
(a) 99 is included with the existing list in mark list.

Question 9.
Which function is used to deletes only element and retains the list?
(a) del ( )
(b) clear ( )
(c) remove ( )
(d) erase ( )
(b) clear ( )

Question 10.
Which function can be used to delete an element using the given index value?
(a) del ( )
(b) clear ( )
(c) pop ( )
(d) remove ( )
(c) pop ( ) Question 11.
Which function can be used to delete the elements if the index value is not known?
(a) del ( )
(b) clear ()
(c) pop ( )
(d) remove ( )
(d) remove ( )

Question 12.
Which function is used to generate a series of values in Python?
(a) pop ( )
(b) range ( )
(c) len ( )
(d) count ( )
(b) range ( )

Question 13.
What is the output?
>>> n= [for x in range (1,10):
>>> print (n)
(a) [1, 2, 3, 4, 5, 6, 7, 8, 9]
(b) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
(c) both (a) and (b)
(d) [2, 3, 4, 5, 6, 7, 8]
(a) [1, 2, 3, 4, 5, 6, 7, 8, 9]

Question 14.
What is the output.
>>> m = [4,3,4,2,4]
>>> n = m.count (4)
>>> print (n)
(a) 4
(b) 3
(c) 2
(d) 5
(b) 3

Question 15.
Choose the incorrect pair:
(a) Positive index – Beginning onwards
(b) Negative index – Reverse order
(c) List – Initial value 1
(d) Tuples – Similar to list
(c) List – Initial value 1 Question 16.
Choose the incorrect pair:
(a) Set – Data type
(b) Index from – Beginning index
(c) Index to – Upper limit
(d) Dictionary – Numeric constant
(d) Dictionary – Numeric constant

Question 17.
Choose the incorrect pair:
(a) List – data type
(b) Tuples – numeric constant
(c) Set – floating constant
(d) Dictionary – exponent
(a) List – data type

Question 18.
Choose the incorrect pair:
(a) remove ( ) – delete element
(b) pop ( ) – delete index value
(c) clear ( ) – delete all element
(d) del ( ) – delete single element
(d) del ( ) – delete single element

Question 19.
Choose the correct pair:
(a) list – immutable
(b) Tuple – mutable
(c) dictionary – mixed
(d) group – single
(c) dictionary – mixed

Question 20.
Choose the correct pair:
(a) union – more sets
(b) intersection – two but not one
(c) difference – common sets
(d) symmetric – first set
(a) union – more sets Question 21.
Choose the incorrect statement:
(a) Python has four collection of data types.
(b) A list is a numeric constant.
(c) Each value list is called as element
(d) The elements can be modified or replaced.
(b) A list is a numeric constant.

Question 22.
Choose the incorrect statement:
(a) A list is simply created by using curly brackets.
(b) Nested list containing another list as an element.
(c) Python assigns automatic in^ex value.
(d) Index value of a list begins with zero.
(a) A list is simply created by using curly brackets.

Question 23.
Choose the incorrect statement:
(a) Python enables reverse or negative indexing list.
(b) Python negative lists index in sequence order.
(c) Python sets -1 as the index value for the last element.
(d) Loops are used to access all elements.
(b) Python negative lists index in sequence order.

Question 24.
Choose the correct statement:
(a) In python, the lists are mutable.
(b) Append ( ) function is used to add more element.
(c) Extend ( ) function is used to add single element
(d) Insert ( ) function is used to insert at last element only.
(a) In python, the lists are mutable.

Question 25.
Choose the correct statement:
(a) del statement is used to delete unknown elements.
(b) remove ( ) is used to delete known elements.
(c) clear () is used to delete all the elements in list.
(d) pop () is used to delete single element and not returns the any element.
(c) clear () is used to delete all the elements in list. Question 26.
Match the following:

 (i) Union (A) — (ii) intersection (B) | (iii) difference (C) ^ (iv) symmetric (D) &

(a) (i) – B, (ii) – D, (iii) – A, (iv) – C
(b) (i) – B, (ii) – A, (iii) – C, (iv) – D
(c) (i) – C, (ii) – D, (iii) – A, (iv) – B
(d) (i) – C, (ii) – A, (iii) – B, (iv) – D
(a) (i) – B, (ii) – D, (iii) – A, (iv) – C

Question 27.
Match the following:

 (i) del ( ) (A) delete unknown element (ii) remove ( ) (B) delete known element (iii) Pop( ) (C) delete only elements (iv) clear ( ) (D) delete and returns

(a) (i) – B, (ii) – C, (iii) – D, (iv) – A
(b) (i) – B, (ii) – A, (iii) – D, (iv) – C
(c) (i) – D, (ii) – A, (iii) – B, (iv) – C
(d) (i) – D, (ii) – C, (iii) – B, (iv) – A
(b) (i) – B, (ii) – A, (iii) – D, (iv) – C

Question 28.
Match the following:

 (i) index from (A) Upper limit (ii) index to (B) Add single (iii) append ( ) (C) Add more (iv) extend ( ) (D) Lower limit

(a) (i) – B, (ii) – D, (iii) – C, (iv) – A
(b) (i) – B, (ii) – C, (iii) – A, (iv) – D
(c) (i) – D, (ii) – C, (iii) – A, (iv) – B
(d) (i) – D, (ii) – A, (iii) – B, (iv) – C
(d) (i) – D, (ii) – A, (iii) – B, (iv) – C Question 29.
Match the following:

 (i) list (A) from list (ii) Tuple (B) mixed (iii) set (C) element (iv) dictionary (D) unordered

(a) (i) – C, (ii) – A, (iii) – B, (iv) – D
(b) (i) – C, (ii) – A, (iii) – D, (iv) – B
(c) (i) – B, (ii) – D, (iii) – A, (iv) – C
(d) (i) – B, (ii) – C, (iii) – A, (iv) – D
(b) (i) – C, (ii) – A, (iii) – D, (iv) – B

Question 30.
Match the following:

 (i) range (1) (A) 5 (ii) range (5, 6) (B) 3 (iii) range (1, 4, 2) (C) 1 (iv) range (1, 1 + 1) (D) 0

(a) (i) – D, (ii) – A, (iii) – B, (iv) – C
(b) (i) – D, (ii) – B, (iii) – C, (iv) – A
(c) (i) – B, (ii) – D, (iii) – C, (iv) – A
(d) (i) – B, (ii) – C, (iii) – A, (iv) – D
(a) (i) – D, (ii) – A, (iii) – B, (iv) – C

Question 31. Assertion (A):
In python, each value of a list is called as element.
Reason (R):
It can be of any type such as numbers, characters, strings and even the nested lists.
(a) Both A and R are true and R is the correct explanation for A.
(b) Both A and R are true but R is not the correct explanation for A.
(c) A is true, but R is falset
(d) A is false, but R is true.
(a) Both A and R are true and R is the correct explanation for A.

Question 32.
Assertion (A):
Python assign an automatic index value for each element of list begin with zero.
Reason (R):
Positive value of index counts from the end of the list.
(a) Both A and R are true and R is the correct explanation for A.
(b) Both A and R are true but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
(c) A is true, but R is false. Question 33.
Assertion (A):
Index to is the lower limit of the range.
Reason (R):
Index from is the upper limit of the range.
(a) Both A and R are true and R is the correct explanation for A.
(b) Both A and R are true but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
(d) A is false, but R is true.

Question 34.
Assertion (A):
The Insert ( ) is used to insert an element at any position of a list.
Reason (R):
Python is used to add more elements in a list. .
(a) Both A and R are true and R is the correct explanation for A.
(b) Both A and R are true but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
(a) Both A and R are true and R is the correct explanation for A.

Question 35.
Assertion (A):
The Tuple ( ) function is used to create Tuples from a list.
Reason (R):
When you create a tuple, from a list, the elements should be enclosed curlly brackets.
(a) Both A and R are true and R is the correct explanation for A.
(b) Both A and R are true but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
(c) A is true, but R is false.

Question 36.
Pick the odd one out:
(a) Tuples
(b) Set
(c) Dictionary
(d) For
(d) For

Question 37.
Pick the odd one out:
(a) append ( )
(b) count ( )
(c) extend ( )
(d) insert ( )
(b) count ( ) Question 38.
Pick the odd one out:
(a) remove ( )
(b) clear ( )
(c) index ( )
(d) pop ( )
(c) index ( )

Question 39.
Pick the odd one out:
(a) Dictionary
(b) Union
(c) Intersection
(d) Symmetric
(a) Dictionary

Question 40.
Pick the odd one out:
(a) copy ( )
(b) count ( )
(c) index ( )
(d) tuple ( )
(d) tuple ( )

Question 41.
Which function is used to add a single element to an existing list?
(a) append ( )
(c) extend ( )
(d) insert ( )
(a) append ( )

Question 42.
Which function is used to add more than one element in an existing list?
(a) append ( )
(c) extend ( )
(d) insert ( )
(c) extend ( )

Question 43.
How many ways to delete element from a list?
(a) 2
(b) 3
(c) 4
(d) 5
(a) 2 Question 44.
What is output?
m = list(range(0, 5, 2))
(a) [2, 4]
(b) [0, 2, 4]
(c) [1, 3, 5]
(d) [0, 3, 5]
(b) [0, 2, 4]

Question 45.
When using sort ( ) function, the default sorting is:
(a) Ascending
(b) Descending
(c) No sorting
(d) Multiple sorting
(a) Ascending

Question 46.
Which of the following can be used to access a particular element in a dictionary?
(a) [ ]
(b) {}
(c) ( )
(d) < >
(a) [ ]

Question 47.
What is a powerful feature in python assignment?
(a) Tuple Assignment
(b) List Assignment
(c) Pair Assignment
(d) Assignment statement
(a) Tuple Assignment

Question 48.
Which key is separated by python dictionary?
(a) ,
(b) :
(c) ::
(d) .
(b) : Question 49.
What is output?
>>> marks = [10, 23, 41, 75]
>>> print (marks[-l])
(a) 10
(b) 23
(c) 75
(d) 41
(c) 75

Question 50.
The key value pair are enclosed with:
(a) [ ]
(b) { }
(c) ( )
(d) All of these
(b) { }

Question 51.
What is the acronym of DBMS?
(a) DataBase Management Symbol
(b) Database Managing System
(c) DataBase Management System
(d) DataBasic Management System
(c) DataBase Management System Question 52.
A table is known as:
(a) tuple
(b) attribute
(c) relation
(d) identity
(c) relation

Question 53.
Which database model represents parent- child relationship?
(a) Relational
(b) Network
(c) Hierarchical
(d) Object
(c) Hierarchical

Question 54.
Relational database model was first proposed by:
(a) E F Codd
(b) E E Codd
(d) E F Codder
(a) E F Codd Question 55.
What type of relationship does hierarchical model represents?
(a) one-to-one
(b) one-to-many
(c) many-to-one
(d) many-to-many
(b) one-to-many

Question 56.
Who is called Father of Relational Database from the following?
(a) Chris Date
(b) Hugh Darween
(c) Edgar Frank Codd
(c) Edgar Frank Codd

Question 57.
Which of the following is an RDBMS?
(a) Dbase
(b) Foxpro
(c) Microsoft Access
(d) SQLite
(d) SQLite Question 58.
What symbol is used for SELECT statement?
(a) σ
(b) Π
(c) X
(d) Ω
(a) σ

Question 59.
A tuple is also known as:
(a) table
(b) row
(c) attribute
(d) field
(b) row Question 60.
Who developed ER model?
(a) Chen
(b) EF Codd
(c) Chend
(d) Chand