0% found this document useful (0 votes)
75 views8 pages

Cs PPT 33

The document is a periodic test question paper for class 11 computer science students. It contains 5 sections with a total of 35 questions ranging from 1 to 5 marks testing concepts like lists, tuples, dictionaries, strings and more.

Uploaded by

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

Cs PPT 33

The document is a periodic test question paper for class 11 computer science students. It contains 5 sections with a total of 35 questions ranging from 1 to 5 marks testing concepts like lists, tuples, dictionaries, strings and more.

Uploaded by

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

QCODE : 11CS-PT2-232401 R.No.

VEDIC VIDYASHRAM SENIOR SECONDARY SCHOOL


TIRUNELVELI-627 358
(Academic Year : 23-24)
Grade: XI COMPUTER SCIENCE (083) Marks : 70
Date : PERIODIC TEST-2 Time : 3:00 Hrs
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A have 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 03 Long Answer type questions carrying 05 marks each.
7. Section E has 02 questions carrying 04 marks each.

Ques. Question Marks


No.
SECTIONA
1 Which statement from the list below will be create a new list? 1
a. new_l = [1, 2, 3, 4]
b. new_l = list()
c. Both a) and b)
d. None of the above
2 What is the output of the following code ? 1
example = "snow world"
example[3] = 's'
print (example)
(a) snow (b) snow world (c) Error (d) snos world
3 1
Which of the following is not a function of tuple?
a)Update( ) b) min( ) c)max ( ) d)count( )

4 What is the output of the following? 1


print('abcdefcdghcd'.split ('cd'))
(a) [‘ab’, ‘ef’, ‘gh’].
(b) ['ab', 'ef', 'gh', ' ']
(c) (‘ab’, ‘ef’, ‘gh’)
(d) (‘ab’, ‘ef’, ‘gh’, ”)

[1]
5 What will be the output of the following code? 1
myList=[1,2,3,4,5,6]
for i in range(1,6):
myList[i-1]=myList[i]
for i in range(0,6):
print(myList[i],end=' ')
a. 2 3 4 5 6 1 b. 6 1 2 3 4 5
c. 2 3 4 5 6 6 d. 1 1 2 3 4 5
6 1
Consider the string str=”Green Revolution” choose the correct statements in
the python to display last four characters
(a) str[-4:] (b) str[:-4:] (c) str[::] (d) str[::-4]

7 Suppose tuple1=[2, 33, 222, 14,25], What is tuple1[ ::-1]? 1


a) [2, 33, 222, 14] b) Error
c) 25 d) [25, 14, 222, 33, 2]

8 What will be the output of the following Python code? 1


a={1:5,2:3,3:4}
print(a.pop(4,9))
(a) 9
(b) 3
(c) Too many arguments for pop() method
(d) 4

9 How many times is the word “HELLO” printed in the following statement? 1
s='python rocks'
for ch in s[3:8]:
print('Hello' )

(a) 6
(b) 5
(c) infinite
(d) 8
10 1
What type of error is returned by the following code :
a={'a' : "Apple", 'b' : "Banana" , 'c' : "Cat"}
print(a[1])

[2]
11 Write the statement to add 50 in a tuple 1
>>>T=(10,20,30,40)

12 Keys of dictionary must be 1


(a) antique (b)unique (c) mutable (d) integers
13 1
Which of the following can add only one value to a list?
a) add ( ) b) append ( ) c)extend( ) d)None of these

14 What is the output of the following? 1


print("xyyzxyzxzxyy".count('xyy', 2, 11))
(a) 2
(b) 0
(c) 1
(d) error
15 Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], which of the following is correct 1
syntax for slicing operation?
a) print(list1[0]) b) print(list1[:2])
c) print(list1[:-2]) d) all of the mentioned
16 Which of the following is correct with respect to above Python code? 1
d={"a":3,"b":7}
(a) a dictionary d is created.
(b) a and b are the keys of dictionary d.
(c) 3 and 7 are the values of dictionary d
(d) All of the above.
Q17and18 are ASSERTION AND REASONING based questions. Mark
the correct choice as
(a) Both A and R are true and R is the correct explanation for A
(b) Both A and Rare true and R is not the correct explanation for A
(c) A is True but R is False
(d) A is False but Ris True

17 Assertion :str1=”Hello” and str1=”World” then print(‘Wo’ not in str1) will 1


print false
Reason : not in returns true if a particular substring is not present in the
specified string.

[3]
18 Assertion :Lists are similar to strings in a number of ways like indexing , 1
slicing and accessing individual elements.
Reason : Lists, unlike strings , are mutable.

SECTION B
19 2
What is the difference between extend( ) and append( ) functions?

20 Consider the following code and find out the error: 2


i) t1=(1,2,3)
t2=t1*(2,)
print(t2)
ii) t1=(1,2,3,4)
t1=t1+10
print(t1)

21 Consider the statement and answer the following: 2

D = {‘red’:10, ‘blue’:15} is a dictionary in python.


(i) Write a python statement to add a new element ‘black’:25 in the
dictionary D.
(ii) Write a python statement to change the value of red to 15 in the
dictionary D.

22 2
Write the output of following Python code:
fruit_list1=['Apple','Berry','Cherry','Papaya']
fruit_list2=fruit_list1
fruit_list3=fruit_list1[:]
fruit_list2[0]='Guava'
fruit_list3[1]='Kiwi'
sum=0
for ls in(fruit_list1,fruit_list2,fruit_list3):
if ls[0]=='Guava':
sum+=1
if ls[1]=='Kiwi':
sum+=20
print(sum)

[4]
23 2
Write a program to remove vowels from a string

24 Predict the Output: 2

L=[2,3,4,6,9,3,8,9)
print (L.index(4))
print (L.count(3))
L.append (L.count(9))
print (L)

25 2
Consider the following dictionary capitals
capitals ={ "Maharashtra": "mumbai", "Delhi" : "New Delhi", "Uttar
pradesh":"Lucknow"}
Find the output of the following statements:-

(i) print(capitals.get("Lucknow"))
(ii) print(capitals.keys())

SECTION C
26 3
Start with the list[8,9,10].Do the following using list functions:
(a) Set the second entry(index1)to17
(b) Add 4,5 and 6 to the end of the list.
(c) Remove the first entry from the list.
(d) Sort the list
(e) Double the list.
(f) Insert 25 at index 3

27 3
Predict the Output:
Msg="CompuTer"
Msg1=''
for i in range(0, len(Msg)):
if Msg[i].isupper():
Msg1=Msg1+Msg[i].lower()
elif i%2==0:

[5]
Msg1=Msg1+'*'
else:
Msg1=Msg1+Msg[i].upper()
print(Msg1)

28 3
Write a program using dictionary to input total number of sections and
streams name of a class 11 and display all information on the output screen.

29 State output of the following 3

List = [12,13,14,15, ‘apple’, ‘mango’]


(i) print(List[2:6:2])
(ii) print(List+['a','b'])
(iii) print(4 in List)

30 Which string method is used to implement the following: 3


a. To count the number of characters in the string
b. To change the first character of the string in capital letter
c. To check whether the given character is letter or a number

SECTION D
Find the answer for the following: 5
31
Results is a dictionary containing Name and Score of students in key: value
pair.
Results= {“A”:240,”B”:340,”C”:350,”D”:280,”E”:370}
a) Print name of all the students having score >250
b) Change marks of student “C” to 450.
c) Calculate average score in this class.
d) Add one more student with name “G” with score 290.
e) Delete entry of student “C” from it.

[6]
32 What does each of the following expressions evaluate to? 5

Suppose that T is the tuple

("These", ("are", "a", "few", "words"), "that", "we", "will", "use")


a) print(T[1][0: : 2])
b) print("a" in T [1] [ 0 ])
c) print(T [ : 1 ] + T[ 1 ])
d) print(T[ 2 : : 2 ])
e) print(T[2][2] in T[1])

33 3+2=5
i). Write a program that takes a list ‘L’ as an argument, add 5 in all the odd
values and 10 in all the even values of the list L. Also display the list

ii) Input a string having some digits. Write a program to calculate the sum
of digits present in this string.

SECTION E
34. 4
Write a program to input line of text from the user until enter is pressed.
Count the total number of uppercase ,lowercase letters and count the total
number of alphabets, digits, symbols in the given text .

35. Write a program to create a dictionary with the roll number, name and 4
marks of n students in a class and display the names of students who have
marks above 75.

[7]
[8]

You might also like