St. Britto Hr. Sec. School - Madurai
12th Computer Science Monthly Test - 1 ( Lists, Tuples, Sets and Dictionary )-Aug 2020
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Write the syntax of creating list. Give example.
-
Write the output for the following code
(i) print (list (range (1, 11, 2)))
(ii) print (list (range(2, 11, 2))) -
Write a python program to print the following output[36,49,64,81,100]
-
How will you create a set using list or tuple? Give an example.
-
What is List in Python?
-
What is output for the following code?
list = ['T', 'T', 'A', 'S', 'L']
list. sort (reverse= false)
print (list) -
Give an example of joining two tuples.
-
Fill up the following to get the output:
10,23,41,75
Marks= [10, 23, 41, 75]
(i)
while i (ii) 4:
print ( (iii) )
i = (iv) -
What is the use of tuple () function? Give example.
-
Write a program to remove duplicates from a list.
-
Write the syntax of deleting elements from the list .
-
How will you change the list elements in Python? Give an example.
-
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 + 1
-
-
Write a note on list comprehensions.
-
What is the output for the following code?
-
-
How will you find the length of a list? Explain with an example.
-
Python program to update/change range of values
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) -
Write a note on dictionary comprehension.
-
Write a note on the following function used in list.
-
Differentiate list and tuple.
-
Write the syntax of remove (), pop () and clear().
-
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.
-
Explain the different set operations supported by python with suitable example.
-
-
Write a program to generate in the Fibonacci series and store it in a list. Then find the sum of all values.
-
Explain the following function used in list function with an example.
(i) copy()
(ii) count()
(iii) index ()
(iv) reverse ()
-
-
What the different ways to insert an element in a list. Explain with suitable example.
-
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. -
How will access all elements of a list? Explain with an example.