12th Standard Syllabus & Materials
12th Standard
TN 12th Standard Biology Zoology - Reproduction in Organisms Creative Questions Study Material - QB365 Set D
NEW12th Standard
TN 12th Standard Biology Zoology - Reproduction in Organisms Creative Questions Study Material - QB365 Set C
NEW12th Standard
TN 12th Standard Biology Zoology - Reproduction in Organisms Creative Questions Study Material - QB365 Set B
NEW12th Standard
TN 12th Standard Biology Zoology - Reproduction in Organisms Creative Questions Study Material - QB365 Set A
NEW12th Standard
TN 12th Standard Physics Electronics and Communication Creative Questions Study Material - QB365 Set D
NEW12th Standard
TN 12th Standard Physics Electronics and Communication Creative Questions Study Material - QB365 Set C

Published on: 03/02/2021
12th Standard Computer Science English Medium Lists, Tuples, Sets and Dictionaries Reduced Syllabus Important Questions With Answer Key 2021
Download Tamil Nadu 12th Standard Computer Science question papers, model tests, one-mark questions, important questions, and public exam papers in PDF format. Free study materials and answer keys for TN State Board students.
Questions + Answers key
Take MCQ Computer Science Test

1.
In Python, a ____________ is a mixed collection of elements but it stores a key along with its element?
Dictionary
Set
Tuple
List
2.
Tuples are enclosed with ________________
[ ]
{ }
( )
< >
3.
Which of the following can be defined with or without()?
list
set
dictionary
none of these
4.
Which function is used to convert the result of range () function in to list?
convert ()
range ()
list ()
listrange ()
5.
Which of the following function is used to delete only are element from a list?
pop ()
del
delete ()
clear ()
6.
How many ways to delete and element from a list?
2
3
4
None of these
7.
Which of the following function used to include an element in a list at a desired position?
append ()
extend ()
insert ()
format ()
8.
Which of the following operator can be used to alter the range of elements in the list?
= =
::
=
9.
Which function is used to set the upper limit in a loop to read all elements of a list?
upper ()
limit
len ()
loop ()
10.
If python sets - 1 as the index value for the last element is called
Oppositive indexing
Tuple indexing
Reverse index
List indexing
11.
Which of the following datatype enclosed with [ ]?
Tuples
List
Dictionary
Set
12.
Which of the following is an ordered collection of values?
Set
Tuples
List
Dictionary
13.
Which of the following is not datatype in Python?
List
Tuples
String
Set
14.
Which of the following Python function can be used to add more than one element within an existing list?
append()
append_more()
extend()
more()
15.
If List=[17,23,41,10] then List.append(32) will result
[32,17,23,41,10]
[17,23,41,10,32]
[10,17,23,32,41]
[41,32,23,17,10]
16.
Give an example of joining two tuples.
17.
Write the output
tup = (10)
type (tup)
tup1 = (10,)
type (tup)
18.
What is the use of tuple () function? Give example.
19.
Write the syntax of using for keyword to access all elements in the list. Pg 136 x 9.
20.
Write the syntax of creating list. Give example.
21.
Write the syntax of creating a Tuple with n number of elements.
22.
Differentiate del with remove( ) function of List.
23.
What will be the value of x in following python code?
List 1 = [2, 4, 6[1, 3, 5]]
x = len (List 1)
24.
What is List in Python?
25.
Write a program that has a list of positive and negative numbers. Create a new tuple that has only positive numbers from the list.
26.
Write a note on the following function used in list.
27.
How will delete an entire tuple? Give an example.
28.
Write a note on Tuple assignment.
29.
Explain with an example how will you create a tuple with a single element.
30.
Differentiate list and tuple.
31.
Read the following program and write the output according to the print statement mentioned
list = ['T', 'H', 'N', 'M']
del list [1]
(i) print (list)
del list [1:3]
(ii) print (list)
del list
(iii) print (list)
32.
How will you find the length of a list? Explain with an example.
33.
How will you create a set using list or tuple? Give an example.
34.
What are the difference between List and Dictionary?
35.
Explain the difference between del and clear( ) in dictionary with an example.
36.
What are the difference between list and Tuples?
37.
Write a program that has a list of positive and negative numbers. Create a new tuple that has only negative numbers from the list.
38.
Explain with an example how will you return multiple values in tuples.
39.
Write a program to create a list of numbers in the range 1 to 10. Then delete all the even numbers from the list and print the final list.
40.
Explain the detail about some important list function with an example.
(i) copy ()
(ii) count ()
(iii) index ()
(iv) reverse ()
41.
What is nested tuple? Explain with an example.
42.
What the different ways to insert an element in a list. Explain with suitable example.
1.
(a)
Dictionary
2.
(a)
[ ]
3.
(d)
none of these
4.
(c)
list ()
5.
(a)
pop ()
6.
(a)
2
7.
(c)
insert ()
8.
(c)
=
9.
(c)
len ()
10.
(c)
Reverse index
11.
(b)
List
12.
(c)
List
13.
(c)
String
14.
(c)
extend()
15.
(b)
[17,23,41,10,32]
16.
# Program to join two tuples
Tup1 = (2,4,6,8,10)
Tup2 = (1,3,5,7,9)
Tup3 = Tup1 + Tup2
print(Tup3)
Output:
(2, 4, 6, 8, 10, 1, 3, 5, 7, 9)
17.
Output:
<class 'tuple'>
18.
(i) 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.
(ii) Example:
MyTup3 = tuple( [23, 45, 90] )
> > > print(MyTup3)
(23, 45, 90)
19.
Syntax:
for index_var in list:
print (index_ var)
20.
Syntax:
Variable = [element-1, element-2, element-3 ................ elernent-n]
Example:
Marks = [10,23,41,75]
Fruits = ["Apple", "Orange", "Mango", "Banana"]
MyList = [ ]
21.
Syntax:
# Tuple with n number elements
Tuple_Name (E1, E2, E3.......En)
# Elements of a tuple without parenthesis
Tuple_Name = El, E2, E3 ................. En
22.
| del function | remove () function | |
| (i) | del statement is used to delete elements whose index is known. | move( ) function is used to delete elements of a list if its index is unknown. |
| (ii) | The del statement can also be used to delete entire list. | The remove ( ) function can be used to delete one or more elements if the index value is not known. |
23.
4
24.
A list in Python is known as a "Sequence data type" like strings. It is an ordered collection of values enclosed within square brackets [ ]. Each value of a list is called as element.
25.
Program:To create a tuple having positive numbers.
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)
26.
| max( ) | Returns the maximum value in a list |
max (list) |
MyList=[21, 76, 98, 23] print(maxtMyList) Output: 98 |
| min( ) | Returns the minimum value in a list. |
min (list) |
MyList=[21, 76, 98, 23] print(min(MyList) ) Output: 21 |
| sum( ) | Returns the sum of values in a list. |
sum (list) |
MyList=[21, 76, 98, 23] print(sum(MyList) ) Output: 218 |
27.
(i) To delete an entire tuple, the del command can be used.
(ii) Syntax: del tuple_name
(iii) Example:
Tup1 = (2, 4, 6, 8, 10)
print("The elements of Tup1 is ", Tup 1)
del Tup1
print (Tup 1)
28.
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.
Example:
> > > (a, b, c) = (34, 90, 76)
> > > print(a.b,c)
34 90 76
29.
(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; not a tuple. Creating a Tuple with one element is called "Singleton" tuple.
(iii) Example:
Example:
> > > MyTup4 = (10)
> > > type(MyTup4)
< class 'int' >
> > > MyTup5 = (10,)
>>> type(MyTup5)
< class 'tuple' >
30.
(i) In a list, elements are defined within square brackets, whereas in tuples, they may be enclosed by parenthesis.
(ii) The elements of a tuple can be even defined without parenthesis.
(iii) Whether the elements defined within parenthesis or without parenthesis, there is no differente in it's function.
31.
Output:
(i) ['T', 'N', 'M']
(ii) ['T'
(iii) Error
32.
(i) The len( ) function in Python is used to find the length of a list. (i.e., the number of elements in a list).
(ii) Usually, the len( ) function is used to set the upper limit in a loop to read all the elements of a list.
(iii) If a list contains another list as an element, len( ) returns that inner list as a single element.
(iv) Example: Accessing single element
> > > MySubject = ['Tamil', 'English', 'Comp', 'Science', 'Maths']
> > > len(MySubject)
4
33.
A list or Tuple can be converted as set by using set( ) function. This is very simple procedure. First you have to create a list or Tuple then, substitute its variable within set( ) function as argument.
Example:
MyList= [2, 4, 6, 8, 10]
MySet=set(MyList)
print(MySet)
Output:
{2, 4, 6, 8, 10}
34.
(i) List is an ordered set of elements. But, a dictionary is a data structure that is used for matching one element (Key) with another (Value).
(ii) The index values can be used to access a particular element. But, in dictionary key represents index. Remember that, key may be a nunmber of a string.
(iii) Lists are used to look up a value whereas a dictionary is used to take one value and look up another value.
35.
| del | Clear( ) | |
| (i) | The del statements is used to delete elements whose index is known. | The function clear ( ) is used to delete all the elements in list. |
| (ii) | The del statement can also be used to delete entire list. | It deletes only the elements and retains the list. |
| (iii) | Example: del Dict ["MarkT"] | Example : Dict.clear( ) |
36.
(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 parenthesis().
(iii) Iterating tuples is faster than list.
37.
Program:
n = {5,-8, 6, 8, -4, 3, 1}
negative = 0
for i in n:
if {n < 0)
negative + = (i,)
print (negative)
38.
(i) A function can return only one value at a time, but Python returns more than one value from a function. Python groups multiple values and returns them together.
(ii) Example: Program to return the maximum as well as minimum values in a list
def Min_Max(n):
a = max(n)
b = min(n)
return (a, b)
Num = (12, 65, 84, 1, 18, 85, 99)
(Max_Num, Min_Num) = Min_Max(Num)
print("Maximum value = ", Max_Num)
print("Minimum value = ", Min_Num)
(iii) Output:
Maximum value = 99
Minimum value = 1
39.
Program:
Num = []
for x in range(1, 11):
Num.append(x)
print("The list of numbers from 1 to 10 = ",Num)
for index, i in enumerate(Num):
if(i%2==0):
del Num[index]
print("The list after deleting even numbers = ", Num)
Output:
The list of numbers from 1 to 10 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
The list after deleting even numbers =. [1, 3, 5, 7, 9]
40.
(i) copy ( ): Returns a copy of the list.
Syntax: List.copy( )
Example:
MyList=[12, 12,36]
x = MyList.copy()
print(x)
Output:
[12, 12, 36]
(ii) count () : Returns the number of similar elements present in the last.
Syntax: List.count(value)
Example:
MyList=[36 ,12 ,12]
x = MyList.count(12)
print(x)
Output:
(iii) index ( ): Returns the index value of the first recurring element.
Syntax: Listindex(element)
Example:
MyList=[36 ,12 ,12]
x = MyListindex(12)
print(x)
Output:
0
(iv) reverse ( ): Reverses the order of the element in the list.
Syntax: List.reverse( )
Example:
MyList=[36, 23, 12]
MyList.reverse()
print(MyList)
Output:
[12, 23, 36]
41.
In Python, a tuple can be defined inside another tuple; called Nested tuple. In a nested tuple, each tuple is considered as an element. The for loop will be useful to access all the elements in a nested tuple.
Example:
Toppers = (("Vinodini", "XII-F", 98.7), ("Soundarya", "XII-H", 97.5),
("Tharani", "XII-F", 95.3), ("Saisri", "XII-G", 93.8))
for i in Toppers:
print(i)
Output:
('Vinodini', 'XII-F', 98.7)
('Soundarya', 'XII-H', 97.5)
('Tharani', 'XII-F', 95.3)
('Saisri', 'XII-G', 93.8)
42.
Inserting elements in a list using insert ( ) :
(i) append ( ) function in Python is used to add more elements in a list. But, it includes elements at the end of a list.
(ii) If you want to include an element at your desired position, you can use insert ( ) function. The insert ( ) function is used to insert an element at any position of a list.
Syntax :
List.insert (position index, element)
Example :
>>> MyList=[34,98,47, Kannan,Gowrisankar','Lenin', 'Sreenivasan' ]
>>> print(MyList)
[34, 98, 47, 'Kannan', 'Gowrisankar', 'Lenin', 'Sreenivasan']
>>> MyList.insert(3, 'Ramakrishnan')
>>> print(MyList)
[34, 98, 47, 'Ramakrishnan', 'Kannan', 'Gowrisankar, 'Lenin', 'Sreenivasan']
Output : [34, 98, 47, 'Ramakrishnan', 'Kannan', 'Gowrisankar', 'Lenin', 'Sreenivasan']
(i) In the above cxample, insert( ) function inserts a new element 'Ramakrishnan' at the index value 3, ie. at the 4th position.
(ii) While inserting a new element in between the existing elements, at a particular location, the existing elements shifts one position to the right.
12th Standard Syllabus & Materials
12th Standard
TN 12th Standard Physics Electronics and Communication Creative Questions Study Material - QB365 Set B
NEW12th Standard
TN 12th Standard Physics Electronics and Communication Creative Questions Study Material - QB365 Set A
NEW12th Standard
TN 12th Standard Physics Wave Optics Creative Questions Study Material - QB365 Set D
NEW12th Standard
TN 12th Standard Physics Wave Optics Creative Questions Study Material - QB365 Set C
Tamilnadu Stateboard 12th Standard Subjects

Maths

Chemistry

Physics

Biology

Computer Science

Business Maths and Statistics

Economics

Commerce

Accountancy

History

Computer Applications

Biology

Computer Technology

Computer Applications

Computer Science

Business Maths and Statistics

Commerce

Economics

Maths

Chemistry

Physics

Computer Technology

History

Accountancy

Tamil

English

French
Tamilnadu Stateboard Standards