MONTHLY TEST- SEP 2025 , XII , COMPUTER SCIENCE (083)
MM: 30 TIME: 60 MIN
General Instructions: i) All questions are compulsory.
ii) Programming Code Language: Python Programming Language
[1] a) Which of the following is an invalid identifier in Python? 1
a) my_variable
b) _my_variable
c) myVariable123
d) 123my_variable
b) Explain the term "type casting" in Python. Give an example 1
c) What will be the output of the given below program: - 1
if 1+3==7:
print("Hello")
else :
print("Know Program")
a. Hello b. Know Program
c. Compiled successfully, no output d . Error
d) What will the following code snippet produce : 1
for i in range(1,5):
print(i,end=" ")
if i==3:
break
a. 1 2 3 b. 1 2 3 4 c. 1 2 d. 1 2 3 4 5.
e) Which of the following is correct with respect to Python Code given 1
below? Coins={"Five":10,"Ten":100}
a. one dictionary named Coins is created.
b. "Five" and "Ten" are the keys of dictionary named Coins
c. 10 and 100 are the values of dictionary named Coins
d. All of these
f) State whether the following given statement is True or False : 1
Statements which are start with # ,never executed by the interpreter.
g) State whether the following given statement is True or False : 1
The list method pop() removes the first element of the list
Assertion (A) and Reason (R) based questions.
a. Both A and R are true, and R is the correct explanation of A.
b. Both A and R are true, but R is not the correct explanation of A.
c. A is true, but R is false.
d. A is false, but R is true.
h) Assertion (A) : Lists in Python are mutable. 1
Reason (R) : You can change, add, or delete elements from a list.
Assertion (A) : Dictionaries are mutable but their keys are immutable.
Reason (R) : The values of a dictionary can change but keys of the
dictionary cannot be changed because through them data is hashed.
i) Assertion (A) : "Hello World".split() returns a list with one element: 1
"Hello World"
Reason (R) : The split() method breaks a string into parts using the
specified separator
j) Assertion (A) : In an if-else statement, the if block checks the true part 1
whereas else checks for the false part.
Reasoning (R) : In a conditional construct, the else block is
mandatory.
[2] a) Observe the following code carefully and rewrite it after removing all 2
syntactical errors. Underline all the corrections made.
def 1func():
a=input("Enter a number"))
if a>=33
print("Promoted to next class")
ELSE:
print("Repeat")
b) Amit, a Python programmer, is working on a project in which he wants 2
to write a function to count the number of even and odd values in the
list. He has written the following code but his code is having errors.
Rewrite the correct code and underline the corrections made.
define EOCOUNT(L):
even_no = odd_no = 0
for i in range(0,len(L))
if L[i]%2=0:
even_no+=1
else:
odd_no+=1
print(even_no, odd_no)
c) Rewrite the following code in python after removing all syntax error(s). 2
Underline each correction done in the code.
colors =list (["red", "green", "blue",] )
[
colors.remove "green" ]
my_tuple = (10, 20, 30 )
tuple1 = (1, 2)
tuple2 = (3, 4)
result = tuple1 + tuple2 []
print(my_tuple)
print(colors)
d) The following python code is trying to print all vowel characters in a 2
given string. Rewrite the correct code and underline the corrections
made by you.
sub1="computer science"
sub2=""
for i in sub1:
if i in 'aeiou':
sub2=sub2+ str(i)
print(sub2)
e) Predict the output of the following code: 2
m="[email protected]"
for i in range(0,len(str)):
if(str[i].isupper()):
m=m+str[i].lower()
elif str[i].islower():
m=m+str[i].upper()
else:
if i%2==0:
m=m+str[i-1]
else:
m =m+"#"
print(m)
[3] a) Stack implementation can be performed using a list in Python. (True / 1
False)
b) Ravya Industries has set up its new center at Kaka Nagar for its office 5
and web-based activities. The company compound has 4 buildings as
shown in the diagram below: As a Network Expert, need to suggest
the best network-related solutions for them to resolve the
issues/problems mentioned in questions (i) to (v), keeping the
following parameters in mind :
Block to Block distance (in meters):
Number of Computers in each block is as follows:
(i) Suggest a cable layout of connections between the
buildings.
(ii) Suggest the most suitable place (i.e. building) to house the
server of this organization with a suitable reason.
(iii) Suggest the placement of the following devices with
appropriate reasons: a. Hub / Switch b. Repeater
(iv) The organization is planning to link its sale counter
situated in various parts of the same city, which type of
network out of LAN, MAN or WAN will be formed? Justify
your answer.
(v) What type of network (PAN, LAN, MAN, or WAN) will be
set up among the computers connected in above
mentioned diagram?
c) The protocol used to transfer files over the Internet is: 1
a. FTP b. HTTP c. SMTP d. IP
[4] a) Which of the following is not a type of computer network? 1
a. LAN b. MAN c. WAN d. SANITIZE
b) Which of the following is not a web browser? 1
a. Chrome b. Firefox c. Windows d. Safari
c) If row[3] represents marks as a string from a CSV file, which is the 1
correct way to compare it numerically?
a. if int(row[3]) > 50:
b. if row[3] > 50:
c. if float(row) > 50:
d. if row > 50: