Computer Science Classxi Annual Exam
Computer Science Classxi Annual Exam
General Instructions:
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
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
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.
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=” ”)
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.
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
Hint: The code should display the count as 3 and index values are [0, 3, 6] as per the
above list.
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.
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.
******************