0% found this document useful (0 votes)
80 views2 pages

Class Xi PT 2 Cs 2022

This document contains a practice test for Class 11 Computer Science with 22 multiple choice questions related to Python lists, tuples, and basic operations on them. Some of the questions test knowledge of initializing and accessing list and tuple elements, mutable vs immutable data types, built-in functions like len(), max(), min() etc. Other questions involve writing small programs to find maximum/minimum of lists, replacing list elements, appending/extending lists, evaluating expressions etc.

Uploaded by

moammed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views2 pages

Class Xi PT 2 Cs 2022

This document contains a practice test for Class 11 Computer Science with 22 multiple choice questions related to Python lists, tuples, and basic operations on them. Some of the questions test knowledge of initializing and accessing list and tuple elements, mutable vs immutable data types, built-in functions like len(), max(), min() etc. Other questions involve writing small programs to find maximum/minimum of lists, replacing list elements, appending/extending lists, evaluating expressions etc.

Uploaded by

moammed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

KENDRIYA VIDYALAYA 1STC JABALPUR

Periodic Test-2
Class –XI[Computer Science]
Max. Marks:40

Section-A
1. Consider a declaration L = [(1, 'Python', '3.14'),6].Which of the following represents the
data type of L? 1
a. list b. tuple c. dictionary d. string
2. Mutable data type is: 1
a) Tuple b) String c) List d) None
3.Identify the correct initialization of the List: 1
a) L=1,2,3 b) L=[1,2,3] c) L=[1,2,3,] d) None

4. if Lst=[“Hira”,”Zoya”,”Preet”] what kind of Lst: 1


a) Lst is the list of string c) Both (a) and (b)
b) Lst is the list of character d) None

5. Which of the following will always return a list? 1

a)max() b) min() c) sort() d) None


6. Consider the loop given below: 1
for i in range(10,5,-3):

print(i)

How many times will this loop run

a) 3 b) 2 c) 1 d) Infinite

7.Given a list L=[10,20,30,40,50,60,70], what would L[2:-2] return . 1

a) [10,20,30,40] b) [20,30,40,50] c) [20,30,40] d) [30,40,50]

8. Identify the output of the following Python statements. 1

lst1 = [10, 15, 20, 25, 30]


lst1[3]='1000'
lst1[2]='200'
lst1.insert( 3, 4)
lst1.insert( 2, 3)
print (lst1[-4])
a . 30 b. ‘1000’ c. 4 d.200
9. What will be the output of the following python code? 1
tp=(5,)
tp1=tp*2
printlen(len(tp1))
a. 0 b. 2 c. 1 d. Error
10. Is a*3 equivalent to a+a+a? 1
11. What is the difference between(30) and (30,) 2
12. Tuple is which type of data type explain it with example. 2
13. What is the difference between list and tuple. 2
14. What is the purpose of the following operator (+,*)in List or tuple 2
15. What is the difference between extend() and append() function explain with example? 3
16. Find the error: Rewrite the code in correct form. 2

list1=[4,9,7]
list2=list1*[3,5]
print(list1*3.0)
print(list2
17. Predict an output of the following code: 2
for x in [1,2,3,4,5]:
print(x*2)
18. Ask the user to enter a list containing numbers between 1 and 12 Then replace all the entries
in the list that are greater than 10 with 10. 3
19. Write a program in Python which inputs a list of numbers and find out the maximum and
minimum element of it. For an example, if a list is [82,23,34,45] then output will be
maximum=82 and minimum=23 3
20. Write a program to and display the positive and negative number of the tuple. 3
21. What does each of the following expressions evaluates to ? Suppose that L is the list. 2
[‘These’,[‘are’,’a’,’few’,’words’],’that’,’we’,’will’,’use’]
(a) L[1][3][1:]
(b) L[2][1].upper()
22. What is the output of the following code: 2

ls =[1,3,5,7,9]
print(ls==ls.reverse())
print(ls)
23. What is the output of the following code: 2
bieber=['om','nom','nom']

counts=[1,2,3]

nums=counts

nums.append(4)

You might also like