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

Worksheet List

The document is a chapter test for Class XI Computer Science focusing on Python lists. It includes questions on list manipulation, output prediction, and programming tasks related to lists. The test assesses understanding of list operations, data types, and basic programming concepts.

Uploaded by

rosxdhanushiya
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)
5 views2 pages

Worksheet List

The document is a chapter test for Class XI Computer Science focusing on Python lists. It includes questions on list manipulation, output prediction, and programming tasks related to lists. The test assesses understanding of list operations, data types, and basic programming concepts.

Uploaded by

rosxdhanushiya
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

SRI KRISH INTERNATIONAL SCHOOL(CBSE)

CLASS : XI DATE: 25.11.2024


CHAPTER TEST

COMPUTER SCIENCE (083) LIST IN PYTHON

1. What is the difference between c[:] and c[:-1] assuming c is a list? [1]
2. Find the output of the following [2]
S=[10, “few”,38, “PAIN”,56, “ find”]
for i in range(len(S)):
if type(S[i])==int:
S[i]=S[i]**2
elif type(S[i])==str:
S[i]=(S[i]).swapcase()
print(S)
3. Write the output of the following: [2]
a) list1=[2,3,4,7,53,23,12,9,0]
L=list1.pop(9)
print(L)
print(list1[-4])
print(list1[5:])
b) Write a python statement which will be used to add a new element 14 to a list list1.
4. Find the output of the given questions. [1 ½ ]
L1=[1,2,3,4]
L2=[5,6,7,8]
print(len(L1*2))
print(L1+L2)
print(L1[4])
5. Write a program to calculate the average of the elements which are entered by the user. [2]
#input 5 numbers.
6. Write a program to count the even and odd numbers from the given list and [2]
display the sum of the list. S=[12,43,67,54,90,65,76]
The output should be:
Odd numbers: 3
Even numbers: 4
Sum of List: 407
7. Differentiate between del, remove( ), pop( ) and clear( ). [2]
8. Which of the following is true regarding lists in python? [½]
a) Lists are immutable.
b) Size of the lists must be specified before its initialization.
c) Elements of lists are stored in contiguous memory locations.
9. What will be the output of the following program [2]
L=[10,20,30,40,50,60,70]
x=int(len(L)/2)
for i in range(x):
L[i], L[x+i]=L[x+i], L[i]
print(L)

You might also like