12th Standard Syllabus & Materials
12th Standard
TN 12th Computer Applications மின்னணு தரவு பரிமாற்றம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின் - வணிக பாதுகாப்பு அமைப்புகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின்னணு செலுத்தல் முறைகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின் - வணிகம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications திறந்த மூல கருத்துருக்கள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications வலையமைப்பு வடமிடல் Sample Question Papers Study Material - QB365 Set A

Published on: 03/02/2021
12th Standard Computer Science English Medium Lists, Tuples, Sets and Dictionaries Reduced Syllabus Important Questions 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.
The function _________ is used to join to sets in python.
Join ()
Union ()
Join set ()
Set ()
2.
Iterating ______________ is faster than list.
List
Set
Tuples
Dictionary ()
3.
In list, the positive index number always begin with ______________
Zero
One
- 1
0.0
4.
Which of the following function used to include an element in a list at a desired position?
append ()
extend ()
insert ()
format ()
5.
Which function is used to set the upper limit in a loop to read all elements of a list?
upper ()
limit
len ()
loop ()
6.
If python sets - 1 as the index value for the last element is called
Oppositive indexing
Tuple indexing
Reverse index
List indexing
7.
In li = [10,23,41,75], the negative index value of 41 is
2
-1
-2
-3
8.
Which of the following datatype enclosed with [ ]?
Tuples
List
Dictionary
Set
9.
Which of the following is an ordered collection of values?
Set
Tuples
List
Dictionary
10.
Which of the following is not datatype in Python?
List
Tuples
String
Set
11.
Which of the following set operation includes all the elements that are in two sets but not the one that are common to two sets?
Symmetric difference
Difference
Intersection
Union
12.
Let setA={3,6,9}, setB={1,3,9}. What will be the result of the following snippet?
print(setA|setB)
{3,6,9,1,3,9}
{3,9}
{1}
{1,3,6,9}
13.
Which of the following statement is not correct?
A list is mutable
A tuple is immutable.
The append() function is used to add an element.
The extend() function is used in tuple to add elements in a list.
14.
If List=[10,20,30,40,50] then List[2]=35 will result
[35,10,20,30,40,50]
[10,20,30,40,50,35]
[10,20,35,40,50]
[10,35,30,40,50]
15.
Let list1=[2,4,6,8,10], then print(List1[-2]) will result in
10
8
4
6
16.
Give an example of joining two tuples.
17.
Write a python program to generate the squares of even numbers between 1 and 10 using the concept of list comprehensions.
18.
Write the output for the following code
(i) print (list (range (1, 11, 2)))
(ii) print (list (range(2, 11, 2)))
19.
State the working of pop () and clear () function.
20.
Write a program to display element in a list ("Physics' ,"Chemistry", "Biology") using loop to get the output
Physics
Chemistry
Biology
21.
Write the syntax of creating list. Give example.
22.
What is set in Python?
23.
Differentiate del with remove( ) function of List.
24.
What will be the value of x in following python code?
List 1 = [2, 4, 6[1, 3, 5]]
x = len (List 1)
25.
What is List in Python?
26.
Write a program that has a list of positive and negative numbers. Create a new tuple that has only positive numbers from the list.
27.
Write a python program to read prices of 5 items in a list and then display sum of all the prices, product of all the prices and find the average.
28.
Write a note on Tuple assignment.
29.
Write a program to define a list of countries that are a member of BRICS. Check whether a county is member of BRICS or not.
30.
Explain the concept of list comprehension with an example programs.
31.
Read the following and write the output given by the print function mentione(d)
list = [12, 89, 34, 79, 80]
(I) print (list. remove (34))
(Ii) print (list. pop (1))
(iii) print (list. clear ())
32.
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)
33.
How will you change the list elements in Python? Give an example.
34.
Fill up the following program to get the output TECM.
list = ['T', 'E', 'C', 'M']
i=0
(i) while _________:
(ii) ________ (MySubject[i], ________)
(iii) ____ i = i +
35.
How will you find the length of a list? Explain with an example.
36.
What are the difference between List and Dictionary?
37.
What are the difference between list and Tuples?
38.
Write a program that has a list of positive and negative numbers. Create a new tuple that has only negative numbers from the list.
39.
Explain with an example how will you return multiple values in tuples.
40.
Explain the detail about some important list function with an example.
(i) copy ()
(ii) count ()
(iii) index ()
(iv) reverse ()
41.
How will you access elements of a list using for loop? Explain with an example.
42.
What the different ways to insert an element in a list. Explain with suitable example.
1.
(b)
Union ()
2.
(c)
Tuples
3.
(b)
One
4.
(c)
insert ()
5.
(c)
len ()
6.
(c)
Reverse index
7.
(c)
-2
8.
(b)
List
9.
(c)
List
10.
(c)
String
11.
(a)
Symmetric difference
12.
(d)
{1,3,6,9}
13.
(d)
The extend() function is used in tuple to add elements in a list.
14.
(c)
[10,20,35,40,50]
15.
(b)
8
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.
s = [x **2 for x in range (2,11,2)]
print (s)
18.
Output:
(i) [1, 3, 5, 7, 9]
(ii) [2, 4, 6, 8, 10]
19.
(i) pop() function: pope () function can also be used to delete an element using the given index value. pop () function deletes and returns the last element of a list if the index is not given
(ii) clear ( ) function: The function clear( ) is used to delete all the elements in list, it deletes only the elements and retains the list.
20.
MySubject = ["Physics", "Chemistry", "Biology"]
i = 0
while i < len(MySubject):
print (MySubject[i])
i = i + 1
21.
Syntax:
Variable = [element-1, element-2, element-3 ................ elernent-n]
Example:
Marks = [10,23,41,75]
Fruits = ["Apple", "Orange", "Mango", "Banana"]
MyList = [ ]
22.
(i) In Python, a set is another type of collection data type. A'Set is a mutable and an unordered collection of elements without duplicates.
(ii) That means the elements within a set cannot be repeated. This feature used to include membership testing and eliminating duplicate elements.
23.
| 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. |
24.
4
25.
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.
26.
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)
27.
Program:
items=[]
prod=1
for i in range(5):
print ("Enter price for item { } :
"Jormat(i+ 1))
p=int(input 0)
items.append(p)
for j in range(len(items)):
print("Price for item { } = Rs. { }"Jormat(j+ 1,items[j]))
prod = prod" items[j]
print("Sum of all prices- RS.",sum(items))
print("Product of all prices = RS.",prod)
print("Average of all prices = Rs.",sum(items)/
len(items))
Output:
Enter price for item 1 :
5
Enter price for item 2 :
10
Enter price for item 3 :
15
Enter price for item 4 :
20
Enter price for item 5 :
25
Price for item 1= Rs. 5
Price for item 2= Rs. 10
Price for item 3= Rs. 15
Price for item 4= Rs. 20
Price for item 5= Rs. 25
Sum of all prices= Rs. 75
Product of all prices= Rs. 375000
Average of all prices= Rs. 15.0
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.
country=["India", "Russia", "Srilanka", "China", "Brazil"]
is_member = input("Enter the name of the country: ")
if is_member in country:
print(is_member, " is the member of BRICS")
else:
print(is_member, " is not a member of BRICS")
Output:
Enter the name of the country: India
India is the member of BRICS
Output:
Enter the name of the country: Japan
Japan is not a member of BRICS
30.
(i) List comprehension is a simplest way of creating sequence of elements that satisfy a certain condition.
(ii) Syntax:
List = [ expression for variable in range ]
(iii) Example: Generating squares of first 10 natural numbers using the concept of List comprehension.
> > > squares = [x ** 2 for x in range(1, 11) ]
> > > print (squares)
Output:
[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
31.
Output:
(i) 12, 89, 79, 80
(ii) 12, 79, 80
(iii) []
32.
Output:
(i) ['T', 'N', 'M']
(ii) ['T'
(iii) Error
33.
In Python, the lists are mutable, which means they can be changed. A list element or range of elements can be changed or altered by using simple assignment operator (=).
Example:
MyList = [1,3,5,7,9]
print ("List Odd numbers ... ")
for x in MyList:
print (x)
MyList[0:5] = 2, 4, 6, 8, 10
print ("List Even numbers ... ")
for y in MyList:
print (y)
34.
(i) i < len (list)
(ii) print
(iii) end = '\t'
35.
(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
36.
(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.
37.
(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.
38.
Program:
n = {5,-8, 6, 8, -4, 3, 1}
negative = 0
for i in n:
if {n < 0)
negative + = (i,)
print (negative)
39.
(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
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.
(i) In Python, 'for loop' is used to access all the elements in a list one by one. This is just like the for keyword in other programming language such as C++.
(ii) Syntax:
for index_var in list:
print (index_var)
(iii) Here, dex_var represents the index value of each element in the list. Python reads this "for" statement like English: "For (every) element in (the list of) list and print (the name of the) list items"
(iv) Example:
Marks=[23,45, 67, 78,98]
for x in Marks:
print(x)
Output:
23
45
67
78
98
(v) In the above example, Marks list has 5 elements; each element is indexed from 0 to 4.
(vi) The Python reads the for loop and print statements like English: "For (every) element (represented as (x) in (the list of) Marks and print (the values of the) elements.
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 Computer Applications களப்பெயர் முறைமை (DNS) Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications வலையமைப்பு எடுத்துக்காட்டுகள் மற்றும் நெறிமுறைகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications கணினி வலையமைப்பு ஓர் அறிமுகம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications PHP-உடன் MySQL-ஐ இணைத்தல் Sample Question Papers Study Material - QB365 Set A
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