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

11th SC UT 3 Python 2023-24

This document is a unit test for Class XI Computer Science with Python, consisting of multiple-choice questions, fill-in-the-blank questions, and programming tasks. It covers topics such as list operations, output predictions, and differences between Python functions like append() and extend(). The test has a total duration of 1.5 hours and is worth a maximum of 40 marks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

11th SC UT 3 Python 2023-24

This document is a unit test for Class XI Computer Science with Python, consisting of multiple-choice questions, fill-in-the-blank questions, and programming tasks. It covers topics such as list operations, output predictions, and differences between Python functions like append() and extend(). The test has a total duration of 1.5 hours and is worth a maximum of 40 marks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

JAWAHAR NAVODAYA VIDYALAYA MULTHAN DHAR

UNIT TEST – 3
COMPUTER SCIENCE WITH PYTHON
TIME : 1:30 HOURS CLASS XI MAXIMUM MARKS 40

Instructions: All questions are compulsory.


All mcqs are 01 mark each.

1. What will be the output :


nameList = [‘Harsh’, ‘Pratik’, ‘Bob’, ‘Dhruv’] 6. Which statement does not show any error
print nameList[1][-1] after execution? Given L=[1,2,3,4]
a) Pratik a) print(L+L)
b) Bob b) print(L*L)
c) D c) print(L-L)
d) k d) All of the mentioned

2. Find the output: 7. Which command can we use to insert 5 to


Code = [1, 2, 3, 4] the third position in list1?
Code.append([5,6,7,8]) a) list1.insert(3, 5)
print(Code) b) list1.insert(2, 5)
a) [1,2,3,4,5,6,7,8] c) list1.add(3, 5)
b) [1,2,3,4] d) list1.append(3, 5)
c) [1,2,3,4,[5,6,7,8]]
d) [1,2,3,4][5,6,7,8] 8. Which of the following commands will sort
list1 in descending order?
3. Find the output: a) list1.sort(reverse=0)
list1 = [1, 2, 3, 4, 5] b) list1.sort()
list2 = list1 c) list1.sort(reverse=‘True’)
list2[0] = 0; d) list1.sort(reverse=1)
print( list1)
a) [1, 2, 3, 4, 5, 0] 9. pop() returns the element whose index is
b) [0,1, 2, 3, 4, 5] passed as argument to this function and also
c) [0, 2, 3, 4, 5] removes it from the list. If no argument is
d) [1, 2, 3, 4, 0] given, then it returns and removes the
_____element of the list. Fill in the Blank
4. What will be the output of the following Space.
code segment? a) None
list1 =[‘Red’, ‘Green’, ‘Blue’, ‘Cyan’, ‘Magenta’, b) first
‘Yellow’, ‘Black’] c) last
print(list1[-4:0:-1]) d) all
a) [‘Cyan’, ‘Blue’, ‘Green’, ‘Red’]
b) [] 10. Statement 1: append (): Appends a single
c) [‘Cyan’, ‘Blue’, ‘Green’] element passed as an argument at the end of
d) [‘Cyan’, ‘Magenta’, ‘Yellow’, ‘Black’] the list.
Statement 2: extend() Appends each element
5. Which of the following is not an immutable of the list passed as argument at the end of the
data type: given list
a) string Which statement is correct?
b) complex a) Statement 1
c) list b) Statement 2
d) tuple c) Both Statement 1 and 2 are correct
d) Both Statement 1 and 2 are incorrect.
11. In lists, you can change the elements of a list in place. (True/False) 1Mark
12. You can split list elements across several lines. (True/False) 1Mark
13. A list cannot have another list inside one list. (True/False) 1Mark
14. The _______ brackets are used to enclose the values of a list. 1Mark
15. The position of each element in the list is considered as ___________. 1Mark

Q.16- How are Lists are different from the Strings when both are sequences? 3Mark
Q.17- What is the difference between append() and extend() function? 2Mark
Q.18- If a is [1, 2, 3] 4Mark
a) what is the difference (if any) between a * 3 and [a, a, a]?
b) is a * 3 equivalent to a + a + a?
c) what is the meaning of a[1:1] = 9?
d) what's the difference between a[1:2] = 4 and a[1:1] = 4?
Q.19- What does each of the following expressions evaluate to? Suppose that L is the list
["These", ["are", "a", "few", "words"], "that", "we", "will", "use"]. 4Mark

1. L[1][0::2]
2. "a" in L[1][0]
3. L[:1] + L[1]
4. L[2][2] in L[1]

Q.20- Write a Python program to search for an element in a given list of numbers. 4Mark

Q.21- Write a Python Program to count the frequency of a given element in a list of numbers. 4Mark

Q.22- write a Python program to calculate the mean of a given list of numbers. 4Mark

You might also like