0% found this document useful (0 votes)
21 views6 pages

XI AnnualExam CS

The document is a question paper for a Term End Examination in Computer Science for Class XI at National Model Senior Secondary School, Coimbatore. It consists of four sections (A to D) with various types of questions including true/false, short answer, and long answer questions, all focused on Python programming. The paper includes instructions, programming tasks, and coding exercises that require students to demonstrate their understanding of Python concepts and syntax.

Uploaded by

yuganmv18
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)
21 views6 pages

XI AnnualExam CS

The document is a question paper for a Term End Examination in Computer Science for Class XI at National Model Senior Secondary School, Coimbatore. It consists of four sections (A to D) with various types of questions including true/false, short answer, and long answer questions, all focused on Python programming. The paper includes instructions, programming tasks, and coding exercises that require students to demonstrate their understanding of Python concepts and syntax.

Uploaded by

yuganmv18
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/ 6

National Model Senior Secondary School, Coimbatore

TERM END EXAMINATION


COMPUTER SCIENCE
Date: Time allowed: 3Hrs Marks:70
CLASS: XI (ATLANTIC, ANTARCTIC)
General Instructions:
1. This question paper contains four sections, Section A to D.
2. All questions are compulsory.
3. Section A has 18 questions carrying 01 mark each.
4. Section B has 11 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. All programming questions are to be answered using Python Language Only .
SECTION A
State True or False Which of the following is/are an
“Python language is based on Object invalid identifier(s) in Python?
1 Oriented Approach of programming.” 2 a) TotAL b) 1Sum c) Sum_2
d) while
Predict the output. Select the correct output of the code:
d = {"Hema":98, "Neha":95} Str='machine'
3 print(list(d.values())) 4 Str=Str[-5:]
print(Str)
a) chine b) achine c) enich d) Error
Which of the following is not a valid Select the correct output of the code:
mathematical operator in Python . L=[1,2,3,3,2,1]
5 a) ** b) % c) -- d) // 6 print(L[:5:2])
a) [1, 3] b) [2,3,1] c) [1, 3, 2]
d) [1, 2,2,1]
Fill in the blanks . Identify the given Python Object V.
_____ is the default mode in Python . V=10,20,’L’,36.3,[10,20]
7 a) .py b) script c) shell d) Python Mode 8 a) List b) Tuple c) No such Object
in Python d) Error
Fill in the blanks: Identify the Package / Module
____ truncates fractional remainders and required to use the given functions.
9 gives only the whole part as the result. 10 a) floor() b) randrange()
a) Modulus b) Floor division c) Ceil()
d) None of these .
Which statement will terminate the Select the correct output of the code:
execution of a loop. T=(12.3,3.12,1.23,2.32)
11 12
a) continue b) pass c) break d) exit print(T.count('1.23'))
a) -1 b) 1 c) 0 d) Error

Page 1 of 6
Which of the following statement(s) would Find the output for the given
give an error after executing the following statement .
code? print((not True ) or False and True)
str= “Python Programming” #statement 1
13 x= ‘2’ #statement 2 14 a) True b) False c) None d) Null
print(str*2) #statement 3
print(str*x) #statement 4
a) statement 1 b) statement 2
c) statement 3 d) statement 4
Find the output for the given statement. Which of the following is not a
T=(10,20,30,40,50,60) dictionary object function?
del T[2:5] a) pop() b) clear() c)min() d) index()
15 16
print(T)
a) (10,20,60) b) (10,20,30) c) (10,20)
d) Type Error
Which of the following is not a valid import random as r
statement in Python? Value=x.randint(10,20)-2
a) x=10,20 b) x,y=10,20 In the above code segment identify
17 c) x,y=10,20,30 d) x=y=10 18 the minimum and maximum value
that can be assigned to the identifier
Value .
a) 10,20 b) 8,18 c) 10,18 d) 8,20
SECTION B
Aruna has written a code to find the sum of even and odd elements from first 10 natural
numbers. Her code is having errors. Rewrite the correct code and underline the
corrections made.
sume=0
0 =sumo
for i in range of 1,11:
19
if i%2=0:
sume+=i
Else
sumo+=i
print(“The sum of even numbers is:”, sume)
print(“The sum of odd numbers is:”, sumo)
Predict the output of the Python code Differentiate between pop() and
given below: popitem() functions in dictionary with
tuple1 = (10,20,30,40,50,60) suitable examples.
list1 =list(tuple1)
new_list = [] OR
20 for i in list1: 21 Differentiate between count() and
if i%3==0: index() function in list with suitable
new_list.append(i) examples .
new_tuple = tuple(new_list)
print(new_tuple)

Page 2 of 6
Raj,created a Python program using list. a) Find the output for the code
Some parts of the code are missing . segment.
Help him to find the suitable code. x,y,z=1,2,3
Lst=[100,200,300,400,500,600] x*=y
______ # Statement 1 z+=y
22 print(Lst) 23 y-=x
_____ # Statement 2 print(x,y,z,sep='$')
print(Lst)
a) Statement 1 – delete the elements b) Evaluate 24//6-3*2**2
300,400 from the list Lst
b) Add the element 700 to the list Lst
Find the output for the code segment. Find the output t for the code
Str='computer' segment.
Str=Str*2 stud={'A':120,'B':170,'C':240}
24 25
print(Str[::-4],end='#') stud.update({'A':150,'D':300,'C':200})
print(Str[2:10:3]) print(stud)
print(Str.index('o',2))
Find the output for the code segment. Explain any two type of errors in
data = [2,4,2,1,2,1,3,3,4,4] Python with suitable examples .
d = {} OR
for x in data: Differentiate between pop() and
if x in d: remove() functions in List object .
d[x]=d[x]+1
else:
26 27
d[x]=1
print(d)
OR
T='they play we play Lets play'
A=T.partition('play')
B=T.split('play')
print(A,'$',B)
What possible outputs(s) are expected to be displayed on screen at the time of
execution of the program from the following code? Also specify the maximum values
that can be assigned to each of the variables FROM and TO.
import random
AR=[20,30,40,50,60,70]
28
FROM=random.randint(1,3)
TO=random.randint(2,4)
for K in range(FROM,TO):
print (AR[K],end=”#“)
(i)10#40#70# (ii)30#40#50# (iii)50#60#70# (iv)40#50#70#
Find the output for the code segment.
a) print("This is","My Python",sep='$',end='*')
print()
29
print("This is My Python",sep='*',end='$')
b) import math
print(math.ceil(63.36),'@',math.floor(-27.72))

Page 3 of 6
SECTION C
a) Find the output for the following code segment.
p,q,r=10,17,23
a,b,c=4,3,7
r,p,q=c//4,b**2,a*2
print(p,q,r,sep='$')
b,a,c=a*p,b//r,c*q
print(a,b,c,sep='#')
b) Find the output for the following code segment.
30
p=32//6
q=p%4
r=p+q
print(p,q,r,sep='&')
p+=p+q-r
r*=p-q+r
q+=p+q
print(p,q,r,sep='*')
Find the output for the following code segment.
T='GoODByE@22'
M=''
for i in range(len(T)):
if T[i].isupper():
M=M+T[i-1]
elif T[i].islower():
M=M+T[i].upper()
elif T[i].isdigit():
M=M+'*'
else:
M=M+'#'
print('The Encrypted text is ' , M)
OR
31 old="THiNk@23"
L=len(old)
new=""
for i in range(0,L):
if old[i].isupper():
new+=old[i+1]
elif old[i].islower():
new+=old[i].upper()
elif old[i].isdigit():
new+=str(old[i])
else:
new+='%'
print("The new text is ",new)

Page 4 of 6
Find the output for the following code segment.
L=[13,15,26,7,9,27,11]
for i in range(len(L)):
if L[i]%2==0:
L[i]*=2
elif L[i]%3==0:
L[i]*=3
elif L[i]%4==0:
L[i]+=4
else:
L[i]*=3
32 print("Updated List is ", L)
OR
A=[7,3,4,5,6,1,2,3,7,3]
print(A[A[A[5]]])
A.insert(5,3)
A.pop(-2)
print(A)
print(A[A[A[5]]])
print(A[-2:2:-2])
print(sorted(A,reverse=False))
del A[3:len(A)-2]
print(A)
Find the output for the following code segment.
L=[4,8,10,12,14,16,18]
T1=tuple(L[::2])
print("The First Tuple is",T1)
33
T2=T1+tuple(L[::-3])
print("The Second Tuple is",T2)
print("Sum of Tuple 1=",sum(T1))
print("Sorting in Tuple 2 = ",sorted(T2))
Find the output for the following code segment.

OR
34 m

Page 5 of 6
SECTION D
Write a program in Python to input a sentence from user and display all the words start
with upper case letter and its count .
For example if the inputted text is This is My Python example
The Expected Output is
Words start with Uppercase are This My Python
Count = 3
35 OR
Write a program is Python to input a text from user and display how many times the
letters ‘a’ and ‘e’ is present in the text .
For example if the inputted text is My name is Meena
The Expected Output is
Total count of letter a is 2
Total count of letter e is 3
Consider a list A= [7,-8,12,36,-45,36,-99,12] . Create two more list name B and C
where B is used to store index location of positive numbers and C is used to store index
location of negative numbers. Print lists B and C .
The Expected Output is
List B is [0,2,3,5,7]
List C is [1,4,6]
36 OR
Consider a list Num=[23,15,21,36,42,55,88] . Create two more list Num1 and Num2
Used to store numbers divisible by 7 and 5 respectively .Print the lists Num1 and
Num2 .
The Expected Output is
List Num1 is [21,42]
List Num2 is [15,55]
Consider a string S = ‘hardware’ , create a dictionary letter used to store all the letters
in the string as the key and the total number of occurrence as the value . Display the
dictionary letter.
The Expected output is
37 The dictionary is {'h':1,'a':2,'r':2,'d':1,'w':1,'e':1}
OR
Create a dictionary Vehicle , where vehicle type as the key and their price as the
value.Input 5 records in to the dictionary and display all the vehicle type those price
above 10 Lakhs from the dictionary Vehicle .

*********************************************************************

Page 6 of 6

You might also like