0% found this document useful (0 votes)
50 views5 pages

Computer Science Classxi Annual Exam

The document is an examination paper for Class XI Computer Science at St. Peter's Senior Secondary School, Kadayiruppu, for the academic year 2022-2023. It consists of multiple sections with varying marks distribution, including questions on Python programming, cybercrime, and data structures. The paper tests students' knowledge through multiple-choice questions, coding tasks, and theoretical explanations.
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)
50 views5 pages

Computer Science Classxi Annual Exam

The document is an examination paper for Class XI Computer Science at St. Peter's Senior Secondary School, Kadayiruppu, for the academic year 2022-2023. It consists of multiple sections with varying marks distribution, including questions on Python programming, cybercrime, and data structures. The paper tests students' knowledge through multiple-choice questions, coding tasks, and theoretical explanations.
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/ 5

ST.

PETER’S SENIOR SECONDARY SCHOOL, KADAYIRUPPU


ANNUAL EXAMINATION 2022-‘23
Computer Science
Class XI Marks:70
Date: 03/03/2023 Time:3hrs

General Instructions:

 Section A has 16 questions and carries I mark each.


 Section B has 9 questions and carries 2 marks each.
 Section C has 8 questions carries 3 marks each.
 Section D has 3 questions and carries 4 marks each.

SECTION - A
1. Consider the following expression:
not True and False or not False
Which of the following will be the output, if the above gets executed?
a) True b) False c) None d) NULL

2. Which of the following operation is supported in python with respect to tuple t?


a) t[1]=33 b) t.append(33) c) t=t+t d) t.sum()

3. The input( ) function always returns a value of ….……………..type.


a) Integer b) float c) string d) Complex

4. Which of the following is considered as the unsolicited commercial email?


a) Virus b) Spam c) Malware d) All of the above

5. What will the expression 2 + 9 * ( ( 3 * 12) – 8 ) / 10 evaluates?


a) 29.2 b) 25.2 c) 27.2 d) 27

6. Give the output of the following code:


>>>import math
>>>math.ceil(1.03)+math.floor(1.03)
a) 3 b) -3.0 c) 3.0 d) None of these
7. Write the output of the following.
print(“A#B#C#D#E”.replace(“#”,”?”))
a) A#B#C#D#E
b) A?B?C?D?E
c) Cannot replace as strings are immutable
d) Error

8. Your friend Sarika complaints that somebody has created a fake profile on Twitter
and defaming her character with abusive comments and pictures. Identify the type of
cybercrime for these situations.
a) Cyber stalking b) Identity Theft c) Spoofing d) Bullying

9. Which among the following in not a function of math module?


a) pow( ) b) range( ) c) fabs( ) d) sqrt( )

1
10. S=”PROGRAMMING IS FUN”. What will be produced as output, if S*-15:-16] gets
executed?
a) Error b) Empty String c) ‘H’ d) None of these.

11. State whether True/False.


The # symbol used for inserting comments in python is a token.

12. A dictionary named book is as follows:


Book=,1:”Thriller”,2:”Mystery”,3:”Crime”,4: “Stories”-
Ramesh needs to change the title in the dictionary from “Crime” to “Crime Thriller”.
He has written the following command.
Book*“Crime”+=”Crime Thriller”.
But he is not getting the answer. Help him to write the correct command.

13. What will the following code print?


for i in range (91,100):
if chr(i)==’a’:
pass
else:
print(i)
14. If the variable str contains “Global Warming”, then what will be the slicing code to
display the last 4 characters.

15. The _______________keyword marks the beginning of a function.

16. Assertion(A):Higher precedence operator is evaluated before the lower precedence


operator.
Reason(R): For operators with equal precedence, the expression is evaluated from
right to left.
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.
SECTION-B

17. Consider a nested List as below:


L1=[1,2,3,*‘Computer’,’device’+,4,5,*‘forty’,‘sixty’+,6,7,8+
Predict the output:
i) print(L1[3][0])
ii) print(L1[3][0][0:4])
iii) print(L1[6][1][3])
iv) L1*3+*1+=”Memory”
print(L1)

18. Read the code carefully and what is the output produced?
L=[6,12,18,24,20]
for i in L:
for j in range(1, i%5):
print( j ,’#’, end=’’)
print()

2
19. What possible output(s) are expected to be displayed on screen at the time of
execution of the following code? Also specify the maximum and minimum value that
can be assigned to variable X.
import random
L=[10,7,21]
X=random.randint(1,2)
for i in range(X):
Y=random.randint(1,X)
print(L*Y+,”$”,end=” ”)

(a) 10 $ 7 $ (b) 21 $ 7 $ (c) 21 $ 10 $ (d) 7 $

20. Predict the output:


Msg1="WeLcOME"
Msg2="GUeSTs"
Msg3=""
for I in range(0,len(Msg2)+1):
if Msg1[I]>="A" and Msg1[I]<="M":
Msg3=Msg3+Msg1[I]
elif Msg1[I]>="N" and Msg1[I]<="Z":
Msg3=Msg3+Msg2[I]
else:
Msg3=Msg3+"*"
print(Msg3)

21. Aman has write the code to find factorial of an integer number as follow. But he has
got some error while running this program. Kindly help him to write the corrected
code. Underline each corrections made.

num=Int(input( ))
fact=1
for x of range(num,1,-1)
if num=1 or num=0:
print("Fact=1")
break
else:
fact=Fact*x
print(fact)

22. Lists and tuples are sequences that can store elements of different data types. In
what ways are they different from each other? Explain with proper examples.

23. Define the terms:


a) Cookies
b) Plagiarism

24. What is meant by Proprietary software? Give Examples.

25. Assume a dictionary with some contents in it as shown below:

3
Stu=,1:”Neha”,2: “Saima”,3:”Avnit”,4:”Ana”,5:”Shaji”-
Write a code in Python to delete the student details from the back end till the
front end. ie, the details of Shaji, followed by Ana, Avnit, Saima and Neha gets
deleted.
SECTION-C
26. a) Out of the following four option(s), which can be the correct output produced
for the following code.

import random
p=["Computer","Mouse","Keyboard","Pen Drive"]
for i in range (1, 4):
print(p[random.randrange(i)],end=" ")
print()

#Output Options:
i. Mouse Keyboard Pen drive ii. Computer Computer Keyboard
iii. Computer Computer Mouse iv. None of the above

b) Write one word for the following:


i) Derogatory messages or comments posted online targeting people.
ii) Records and traces individuals’ activities as they use the Internet.

27. A dictionary content is as follows:


Menu = ,“Pizza”:200,”SoftDrinks”:110,”Burger”:100,”Hotdog”:250-
Write a code in Python which will create a list named ‘snacks’ from the above
dictionary. The list should be filled with only those item names whose length exceeds
6.

28. A list of integers is given below:


Numbers= [123,45,67.8,456,23,1,900]
Write a program in Python to display the count of all 3 digit integers and print the
index values.

Hint: The code should display the count as 3 and index values are [0, 3, 6] as per the
above list.

29. Differentiate between:


a) Virus and Worms
b) Spyware and Adware

30. Write a code in python to add ‘n’ names into a list. Print the modified list in such a
manner that all the names are converted to uppercase characters.
Hint: If the list initially contains *“anu”,”preetha”,”sinu”+ then the modified list should
be *“ANU”,”PREETHA”,”SINU”+

31. Write a code in Python to accept a number, print all its divisors and print with an
appropriate message whether it is perfect number or not.

4
32. Write a program code in Python to input a line of string. Count the number of words
starting with an upper case “vowel”.
Hint:
if the inputted string is “India is my country. New Delhi is the capital Of India”.
Then, the count is = 3.

33. Akansha is trying to do the following tasks. Help her with the appropriate Python
inbuilt function:
a) Merge two dictionaries into one.
b) To search for a particular sub string in the main string.
c) To remove an element from the list and return it.
SECTION -D
34. Write a menu driven python program to do the following tasks as per the user’s
choice:
1. Create a dictionary named inventory with key:value pairs as productcode:
price.
2. Look up for a particular product based on the product code and display the
associated price.
3. Increment the existing price by 500 for the productcode “A001”.
4. Display the dictionary.

35. Krishnakumar of class 11 is writing a program to check whether square root of a given
number is prime or not. Some Codes are given below. Help him to complete the
program.

import ________ #Line 1


n=int(input(“Enter a number”))
m=int(math._______(n)) #Line3
k=0
for i in __________(2 , m//2+1): #Line4
if m%i==0:
k=k+1
ik k==0:
print(m,”which is the square root of “,n,”is a prime number”)
else:
print(m,”which is the square root of “,n,”is not a prime number”)

a) Name the module that he should import in Line1


b) Name the function used to find the square root in Line3.
c) Name the function needed to execute Line 4.
d) What will be the output if the value of n is 16?

36. Write a code in Python which accepts a line of string and does the following tasks
according to the user’s choice.
1. Print the string in toggle case.
2. Count the number of digits.
3. Print the index of an inputted character.
4. Print the reversed string.

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

You might also like