Xii CS WS-1 20.06.2025
Xii CS WS-1 20.06.2025
FUNCTIONS IN PYTHON
I.MULTIPLE CHOICE QUESTIONS (MCQ):
1.What possible output(s) from the given options is expected to be displayed when the
following code is executed?
import random
Cards=[“Heart”, “Spade”, “Club”, “Diamond”]
for I in range(2):
print(Cards[random.randint(1,i+2)], end=”#”)
(a) Spade#Diamond# (b) Spade#Heart#
(c) Diamond#Club# (d) Heart#Spade#
2.Consider the statements given below and then choose the correct output from the given
options:
def Change(N):
N=N+10
print(N, end=’$$’)
N=15
Change(N)
print(N)
(a) 25$$15 (b) 15$$25 (c) 25$$25 (d) 2525$$
3.Consider the code given below:
b=5
def myfun(a):
______________ #Missing statement
b=b*a
myfun(14)
print(b)
Which of the following statements should be given in the blank for #Missing statement, if
the output produced is 70?
(a) global a (b) global b=70 (c) global b (d) global a=70
4.Assertion (A): The default argument in Python functions can be mutable types like lists
and dictionaries.
Reason(R): Mutable default arguments retain their state across function calls, which can
lead to unexpected behavior.
(a) Both (A) & (R) are true and (R) is the correct explanation of (A).
(b) Both (A) & (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.
5.What possible output(s) are expected to be displayed on the screen at the time of
execution of the program from the following code?
import random
temp=[10,20,30,40,50,60]
c=random.randint(0,4)
for i in range(0,c):
print(temp[i],”#”)
(a) 10#20# (b) 10#20#30#40#50# (c)10#20#30# (d)50#60#
6.When a Python function does not have return statement then what it returns?
(a) int (b) float (c) None (d) Give Error
7.In the given program, identify which are local and global variables?
def change():
n=10
x=5
print(x)
(a) n and x both are local variables (b) n and x both are global variables
(c) n is global and x is local variable (d) n is local and x is global variable
1
8. Assertion (A): A Variable declared as global inside a function is visible outside the
function with changes made to it inside the function.
Reason(R): global keyword is used to change the value of a global variable.
(a) Both (A) & (R) are true and (R) is the correct explanation of (A).
(b) Both (A) & (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.
9.What will be the output of the following python code?
v=50
def change(n):
global v
v,n=n,v
print(v,n,sep=”#’,end=”@’)
change(20)
print(v)
(a) 20#50@20 (b) 50@20#50 (c) 50#50#50 (d)20@50#20
10. Assertion (A): A parameter having a default value in the function header is known as
a default parameter.
Reason(R): The default values for parameters are considered only if no value is provided
for that parameter in the function call statement.
(a) Both (A) & (R) are true and (R) is the correct explanation of (A).
(b) Both (A) & (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.
2
(a) A* (b) A*D* (c) A*d*v* (d) A*d*v*e*n*t*u*
7.The code provided below is intended to reverse the order of elements in a given list.
However, there are syntax errors and logical errors in this code. Rewrite it after removing
all errors. Underline all the corrections made.
def reverse_list(lst)
if not lst:
return lst
reversed_lst=lst[::-1]
return reversed_lst
print(“Reversed list:”reverse_list[1,2,3,4])
COMPUTER NETWORKS
I.MULTIPLE CHOICE QUESTIONS (MCQ):
1.Which of the following networking devices is used to regenerate and transmit the
weakened signal ahead?
(a) Hub (b) Ethernet card (c) Repeater (d) Modem
2.Which of the following options is the correct protocol used for phone calls over the
internet?
(a) PPP (b) FTP (c) HTTP (d) VoIP
3.________ is a standard mail protocol used to receive emails from a remote server to a
local email client.
(a) SMTP (b) POP (c) HTTP (d) FTP
4.Pawan wants to transfer files and photos from laptop to his mobile. He uses Bluetooth
technology to connect two devices. Which type of network will be formed in this case?
(a) PAN (b) MAN (c) LAN (d) WAN
5.What Modem does?
(a) Modulation (b) demodulation (c) Both (a) & (b) (d) None of these
6._________ is the first page that normally view at a website.
(a) First page (b) Master page (c) Home page (d) Login page
7.A device that connects networks with different protocols.
(a) Switch (b) Hub (c) Gateway (d) Proxy server
8.Which protocol is used to send e-mail over internet?
(a) FTP (b) TCP (c) SMTP (d) SNMP
9.Which device is primarily used to amplify and regenerate signals in a network, allowing
data to travel longer distances?
(a) Switch (b) router (c) repeater (d) bridge
10.Which communication technique establishes a dedicated communication path between
two devices for the entire duration of a transmission, ensuring a continuous and consistent
connection?
(a) Circuit switching (b) packet switching (c) Message switching (d) All of these
3
related solutions for them to resolve the issues/problems mentioned in questions (i) to
(vi), keeping the following parameters in mind.
Block to Block Distances in meters:
From To Distance
ADMIN PSYCHIATRY 65 m
ADMIN PSYCHOLOGY 65 m
ADMIN ICU 65 m
PSYCHIATRY PSYCHOLOGY 100 m
PSYCHIATRY ICU 50 m
PSYCHOLOGY ICU 50 m
Distance of Nagpur Head Office from Vijayawada center =700 km
Number of Computers in each block is as follows:
Block No. of Computers
ADMIN 16
PSYCHIATRY 40
PSYCHOLOGY 19
ICU 20
(i) Suggest the most appropriate location of the server inside the Vijayawada
center. Justify your choice.
(ii) Which hardware device will you suggest to connect all the computers within
each block of Vijayawada center?
(iii) Draw a cable layout to efficiently connect various blocks within the Vijayawada
center.
(iv) Where should the router be placed to provide internet to all the computers in
the Vijayawada center?
(v) (a) The Manager at Nagpur wants to remotely access the computer in Admin
block in Vijayawada. Which protocol will be used for this?
(vi) Which type of network (PAN, LAN, MAN or WAN) will be set up among the
computers connected within Vijayawada center?
2.Superior education society is an educational Organization. It is planning to setup its
campus at Nagpur with its head office at Mumbai. The Nagpur Campus has 4 main
buildings- ADMIN, COMMERCE, ARTS and SCIENCE. You as a network expert have to
suggest the best network related solutions for their problems raised in a to g, keeping in
mind the distances between the buildings and other given parameters:
Shortest distances between various buildings:
Admin to Commerce-55m
Admin to Arts- 90m
Admin to Science- 50m
Commerce to Arts- 55m
Commerce to Science- 50m
Arts to Science- 45m
Mumbai Head office to Nagpur office- 850 KM
Number of Computers installed in various buildings are as follows:
Admin-110
Commerce-75
Arts-40
Science-12
Mumbai Head office-20
(a) Suggest the most appropriate location of the server inside the Nagpur campus to
get the best connectivity for maximum number of computers. Justify your
answer.
(b) Suggest and draw the cable layout to efficiently connect various buildings within
the Nagpur campus for connecting the computers.
(c) Which of the following will you suggest to establish the online face to face
communication between the people in the ADMIN office of Nagpur Campus and
Mumbai Head Office?
(i) Cable TV (ii) Video Conferencing (iii) E-mail (iv)Text Chat
4
(d) Suggest the placement of following devices with appropriate reason:
(i) Hub/Switch (ii) Repeater (iii) router
(e) Suggest the device/ software to be installed in Nagpur Campus to take care of
data security and unauthorized access.
(f) Which type of network is formed between Nagpur Office to Mumbai Head Office?
(g) Suggest a protocol that shall be needed to provide Video Conferencing solution
between Nagpur Campus and Mumbai Campus.
3.HiTech Info Ltd. Wants to setup their computer network in Bangalore based campus
having four buildings. Each block has a number of computers that are required to be
connected for ease of communication, resource sharing and data security. You as a
network expert have to suggest answers to these parts (a) to (f) raised by them.
(a) Suggest the most suitable block to host the server. Justify your answer.
(b) Suggest the wired medium and draw the cable layout (block to block) to
economically connect various blocks.
(c) Suggest the placement of the following devices with justification:
(i) Hub/Switch (ii) Repeater
(d) Suggest the device that should be placed in the server building so that they can
connect to Internet Service Provider to avail Internet services.
(e) What is the suggestion for high speed wired communication medium between
Bangalore campus and Mysore campus to establish a data network?
(i) TWP Cable (ii) CoAxial cable (iii) OFC (iv) UTP Cable
(f) What type of network ( PAN/LAN/MAN/WAN) will be set up among the computers
connected in the campus?