0% found this document useful (0 votes)
142 views7 pages

CS Ann Sample Paper

Uploaded by

prasanjitm7707
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)
142 views7 pages

CS Ann Sample Paper

Uploaded by

prasanjitm7707
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/ 7

DELHI PUBLIC SCHOOL

NAVI MUMBAI
ANNUAL EXAMINATION SAMPLE PAPER 2024-2025

Class –XI M.Marks-70


Subject - Computer Science(083) Duration-3 Hrs
General Instructions:
Please check this question paper contains 35 questions printed in 9 pages.
The paper is divided into 5 Sections- A, B, C, D and E.
Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
All programming questions are to be answered using Python Language only.
SECTION A
1. State True or False:
The expression 2**2**3 is evaluated as (2**2)**3.
2.Evaluate the following expression and identify the correct answer.
16 - (4 + 2) * 5 + 2**3 * 4
a. 54 b. 46 c. 18 d. 32
3. What gets printed when the following code is executed?
names = [‘Hasan’,’Balwant’,’Sean’,’Dia’]
print(names[-1][-1])
(a) i (b) D (c) Dia (d) a
4. Which among the following operators has the highest precedence?
a)** b)% c) // d)+
5. Which of the following is not a valid identifier ?
a) ABC b) _num c) Print d)4map
6. To use randint(a,b) which of the following module should be imported ?
a)math b)random c)CSV d) randinteger
7. What will be the output when the following code is executed?
L= [1,3,5,4,8,9]
print(L[-1:-5])
8. Identify the mutable data types?

Page 1 of 7
(a) List (b) Tuple (c) Dictionary (d) String

9. Lalit is a game programmer and he is designing a game where he has to use different
python functions as much as possible. Apart from other things, following functionality is to
be implemented in the game.
The players have to input their names and Lalit has to remove the unnecessary blank
spaces from the name
Which python module and function should be used for the same:

a) remove() function of string module b) split function()


c) trim() function of string module d) strip() function of string module
10. In a range function, which of the following argument is mandatory to pass:
a) Start b) Stop c) Step d) All of these
11. Predict the output of the following
s='''One, two, three, four, five
Once I caught a fish alive. '''

print(s.count('e',20))

(a) 20 (b) 1 (c) 3 (d) 6


12. Which of the following is not a valid Python string operation ?

(a) 'Welcome' + '10' (b) 'Welcome' * 10


(c) 'Welcome' * 10.0 (d) "10" + 'Welcome'
13. What will be the output for the following Python statements ?

L =[10, 20, 30, 40, 50]


L=L+5
print(L)

(a) [10, 20, 30, 40, 50, 5] (b) [15, 25, 35, 45, 55]
(c) Error (d) [5, 10, 20, 30, 40, 50]
14. Identify the output of the following Python statements

S = "GOOD MORNING"
print(S.capitalize(),S.title(),end="!")

(a) GOOD MORNING!Good morning (b) Good Morning!Good morning


(c) Good morning!Good Morning! (d) Good morning Good Morning!
15. Given the Python declaration S1 = "Hello". Which of the following
statements will give an error ?

(a) print(S1[4]) (b) S2=S1 (c) S1=S1[4] (d) S1[4]="Y"

16 Suppose list1 is [3, 4, 5.0, 20, 5], what is list1.index(5) ?

Page 2 of 7
a) 0 b) 1 c) 4 d) 2
Q17 and 18 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 R are true and R is not the correct explanation for A
(c) A is True but R is False
(d) A is false but R is True
17.

18. Assertion(A): Assigning a list name to a new name does not create a true copy of a list
rather it just creates an alias.
Reasoning(R): An alias simple refers to the old list with a new name, while a true copy
creates a new list with a different memory location.
SECTION B
19. Rao has written a code to generate Fibonacci series in a tuple. His code is having some
errors. Correct the syntax and logical errors and rewrite the corrected code.
p1=0, p2=1
fib=(p1,p2)
for i in range(3,10):
n=p1+p2,
fib+=n
p1= =p2
p2=n
print(fib)

20. Find the output of the codes given below:


a. mystr = 'Hello I am a Human.'
print(mystr[::-3])

b. p=10
q=20
p*=q//3
p=q**2
q+=p
print(p,q)

Page 3 of 7
21. Write the Python statement for each of the following tasks using BUILT-IN
functions/methods only:
(i) To delete the first occurrence of the value 450 from a list L1.
(ii) To convert all the values in a dictionary D to a list.

22. Write a python program to accept a dictionary . Count the number of values in the
dictionary which is a list.
Ex : d= { 1:[25,78], 2:’amit’ , 3:67, 4:[67,89,90] } then the output should be
Number of lists in the dictionary is 2

23. Write 4 differences between a compiler and an interpretor.

24. Predict the output


L1, L2 = [10, 15, 20, 25], []
for i in range(len(L1)) :
L2.insert( i,L1.pop())
print (L1,L2,sep="&")
OR
D=[[1,"One"], [2,"Two"], [3,"Three"]]
L=[ ]
for K,V in D:
if V[0]=="T":
L.append(K)
print(L)

25. a. What will be the output for the following Python statements ?

T =(10,20,[30,40,50],60,70)
T[2][1]= 100
print(T)

b. Convert 1011010112 to octal

SECTION C

26 a. Explain general purpose application software.


b. What possible output(s) are expected to be displayed on screen at the time of execution of
the following code ?
import random
S=["Pen","Pencil","Eraser","Bag","Book"]
for i in range (1,2):
f=random.randint(i,3)
p=random.randint(i+1,4)
print(S[f],S[p],sep=":")

Page 4 of 7
Options :
(I) Pencil:Book

(II) Pencil:Book
Eraser:Bag

(III) Pen:Book
Bag:Book

(IV) Bag:Eraser

27. Write a program in python to accept a multiline string S. It has to display the lines having
the word India in it. It also has to display the total count of the lines having India in it.

For example:
If the string S is
__________________________________________________________________
INDIA is a famous country all over the world.
Geographically, India is located to the
south of Asia continent. India is a high
population country and well protected
from all directions naturally.
India is a famous country for
its great cultural and traditional
values all across the world.

Output :
INDIA is a famous country all over the world.
Geographically, India is located to the
south of Asia continent. India is a high
India is a famous country for
Total count : 4
OR
Write a program that accepts a string S from the user and counts the number of words in the
string S which are less than 4 characters. The words and the total count has to be displayed.
Ex : S= “An apple a day”
Output:
An
a
day
Total count : 3

28. a. What is ROM ? How is it different from RAM.


b. Briefly explain the use of disk defragmentor.
c. What is the full form of PB, YB.

Page 5 of 7
29. Write the output of the code given below

s="Abc2@xYz"
m=""
for i in range(len(s)):
if s[i].isupper():
m+=s[i].lower()
if s[i].islower():
m+=s[i].upper()
if s[i].isdigit():
m+=s[i-1]
else:
m = m +'#'
print(m)

30. a. Explain the working of the partition method with an example.


b. Mention the datatypes for which the functions given below work.
split , sort , items , insert

SECTION-D

31. Do the following conversions : [2+2+1]


a. 345610 to octal
b. ADF616 to decimal
c. 4510 to binary

32 a) Study the following program and write the output [2+3]


s='''Baa baa black sheep, have you any wool?'''
L=s.split ()
for i in L :
if len(i) %3 != 0 :
print(i, end= " ")

b) Given a string S, write expressions to print


i. First five characters of S
ii. Reversed S
iii. Sorted list of characters from the string S in descending order.

33. (i) Accept a dictionary from the user. Count the number of keys that are tuples. Display
the count. [2+3]
Ex : d={(1,5,6):'ram',2:'sam',(3,4):'ram',4:'pam',5:'sam'}
Output : 2
(ii) Write a program which accepts a string . Make a new string by replacing all vowels in
the string with ‘*’ and print the new string.
Ex : S= “An apple”
Newstring = “*n *ppl*”

Page 6 of 7
SECTION E
34. a. Write the output of the following :
my_lst=['P','R','O','B','L','E','M']
my_lst[2:4]=[]
print(my_lst)
my_lst[2:5]=[3,'RAM']
print(my_lst)

b. Explain typecasting , mutable data type with examples .

35. a. Explain the difference between pop and popitem methods in dictionaries. Explain with
examples.
b. Explain the find method in a string with examples.

Page 7 of 7

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy