Physics
Physics
Physics
1
7 What is the correct way to add an element to the end of a list in Python?
(a) list.add(element) (b) list.append(element)
(c) list.insert(element) (d) list.extend(element)
8 What will be the output of
print("WelcomeToMyBlog"[2:6]+"WelcomeToMyBlog"[5:9])
(a) Lcomme (b) lcommeT (c) lcommeTo (d) lcomme
9 Which of the following statement(s) would give an error during the execution ofthe
following code?
R = { 'pno' : 52, 'pname' : 'Virat', 'expert' : ['Badminton', 'Tennis'], 'score' :
(77, 44) }
print(R) #Statement 1
R['expert'][0] = 'Cricket' #Statement2
R['score'][0] = 50 #Statement3
R['pno'] = 50 #Statement4
(a) Statement1 (b) Statement2 (c) Statement3 (d) Statement4
10 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()
11 Which pickle module method is used to write a Python object to a binary file?
(a) save() (b) serialize() (c) store() (d) dump()
12 Which of the following file opening mode in Python, generates an error if the filedoes not
exist?
(a) a (b) r (c) w (d) w+
13 The syntax of seek() is:
file_object.seek( offset[, reference_point ] )
What is the default value of reference_point?
(a) 0 (b) 1 (c) 2 (d) 3
14 Fill in the blank:
is used for point-to-point communication or unicast
communication such as radar and satellite.
(a) INFRA RED WAVES (b) BLUE TOOTH
(c) MICRO WAVES (d) RADIO WAVES
15 Fill in the blank:
In case of switching, before a communication starts, adedicated
path is identified between the sender and the receiver.
(a) Circuit (b) Packet (c) store and forward (d) none of these
16 Which function returns the sum of all elements of a list?
(a) count() (b) sum() (c) total() (d) add()
2
17 Given is a Python list declaration:
Names = ["Aman", "Ankit", "Ashish", "Rajan", "Rajat"]
Write the output of: print(Names[–1:–4:–1])
(a) ['Rajat', 'Rajan', 'Ashish'] (b) ['Rajat', ' Ashish ', 'Aman']
(c) ['Aman', 'Ankith', 'Ashish'] (d) ['Aman', 'Ashish', 'Rajat']
21 Assertion (A): For changes made to a variable defined with in a function to bevisible outside
the function, it should be declared as global.
Reasoning (R): Variables defined within a function are local to that function bydefault,
unless explicitly specified with the global keyword.
Q. No
Section-B ( 7 X 2 = 14 Marks)
22
Differentiate between Guided and Unguided Transmission.
24 Write the Python statement for each of the following tasks using built-in
functions/methods only:
I
A) To insert an element 200 at the third position, in the list L1.
OR
B) To check whether a string named, message ends with a full stop / period ornot.
3
II.
If L1=[1,2,3,2,1,2,4,2, . . . ], and L2=[10,20,30, . . .], then (Answer using builtin functions only)
26 Rewrite the following code in Python after removing all the syntax errors. Underline
each correction done in the code.
num1, num2 = 10, 45 Whilenum1
% num2 == 0num1 += 20
num2 += 30Else:
Print('hello')
27 I
A) Give two examples of logical operators and arithematic Arithematic operators.
OR
B)Give two examples of logical expressions and Arithematic expressions
II
A) What is implicit type conversion give example
OR
B) What is explicit type conversion give example
28
A) Expand the following : ARPANET,RJ45,MODEM,NSFNET
OR
Section-C (3 x 3 = 9 Marks)
Q. No
4
29 Write a function COUNT() in Python to read from a text file 'Gratitude.txt' anddisplay
the count of the letter 'e' in each line
Example: If the file content is as follows: Gratitude is a
humble heart's radiant glow, A timeless gift that
nurtures and bestows.
It's the appreciation for the love we're shown, In
moments big and small, it's truly known
The COUNT() function should display the output as :Line1:3
Line2:4 Line3:6
Line4:1
OR
Write a function Start_with_I() in Python, which should read a text file
'Gratitude.txt' and then display lines starting with 'I'.
Example: If the file content is as follows: Gratitude is a
humble heart's radiant glow, A timeless gift that
nurtures and bestows.
It's the appreciation for the love we're shown, In
moments big and small, it's truly known
Then the output should be :
It's the appreciation for the love we're shown, In moments
big and small, it's truly known.
5
The output should be : ['Columbo',
'SriLanka']
['Dubai', 'UAE']
['Naypyidaw', 'Myanmar']
Stack Empty
OR
B) Write the definition of a user-defined function
`push_even(N)` which accepts a list of integers in a parameter `N` and pushes all those
integers which are even from the list `N` into a Stack named `EvenNumbers`. Write function
pop_even() to pop the topmost number from the stack and returns it. If the stack is already
empty, the function should display "Empty". Write function Disp_even() to display all
element of the stack without deleting them. If the stack is empty, the function should display
'None'.
for example: If the integers input into the list `VALUES` are: [10, 5, 8, 3, 12] Then the stack
`EvenNumbers` should store: [10, 8, 12]
Section-D (4 X 4 = 16 Marks)
Q. No
6
32 A) Write a function search_replace() in Python which accepts a list L of numbersand a
number to be searched. If the number exists, it is replaced by 0 and if the number
does not exist, an appropriate message is displayed.
Example : L = [10,20,30,10,40]
Number to be searched = 10
List after replacement : L = [0,20,30,0,40]
OR
B) Write a function EOReplace() in Python, which accepts a list L of numbers.
Thereafter, it halves all even numbers and doubles all odd numbers
Example : If Sample Input data of the list is :
L = [10,11,12,13,14,15]
Output will be : L = [5,22,6,26,7,30]
33 Vedansh is a Python programmer working in a school. For the Annual Sports Event, he has
created a csv file named "Result.csv", to store the results of studentsin different sport
events. The structure of Result.csv is :
[St_Id, St_Name, Game_Name, Result]
Where,
St_Id is Student ID (Integer)
St_Name is Student Name (String)
Game_Name is Name of Game in which student is participating (string)
Result is result of the game whose value can be either 'Won', 'Lost' or 'Tie'
For efficiently maintaining data of the event, Vedansh wants to write the followinguser
defined functions:
Accept(): to accept a record from the user and add it to the file Result.csv. The column
headings should also be beaded on top of the csv file.
wonCount(): to count the number of students who have won any event. As aPython
expert, help him complete the task.
34 Write a function Interchange(num) in Python, which accepts a List of integers, "num" and
interchange the first half elements with the second half of the list and print the modified list
as shown below: (Number of elements in the list is assumedas even)
Original List: num = [ 5, 7, 9, 11, 13, 15 ]
After Rearrangement : num = [ 11, 13, 15, 5, 7, 9 ]
35 (a) Name the best wired transmission media used to connect devices.
(b) Write the expanded form of Wi-Fi.
(c) What is the best wireless technology to be used in terrain areas
(d) What is Gateway?
Q. No
Section- E ( 2 x 5 = 10 Marks )
7
Siri is a manager working in a sports agency. She needs to manage the records of various
36 stock. For this, she wants the following information of each stock to be stored:
- Stock_ID – integer
- Stock_Name – string
- Description – string
- Price – float
You, as a programmer of the company, have been assigned to do this job for Siri.
(I) Write a function to input the data of a stock and append it in a binary file.
(II) Write a function to update the data of stock whose price is more than 10000 Rupees
and change their Description to "Very Expensive".
(III) Write a function to read the data from the binary file and display the data of all
those stock which are not "Very Expensive".
37 Fun Media Services Ltd is an event planning organization. It is planning to setup its India
campus in Mumbai with its head office in Delhi. The Mumbai campus will have four
blocks/buildings - ADMIN, DECORATORS, FOOD, and MEDIA. You as a network expert
need to suggest the best network-related solutions for them to resolve the issues/problems
mentioned in points (i)to (v), keeping in mindthe distances between various blocks/buildings
and other given parameters.
FROM – TO DISTANCE
ADMIN to DECORATORS 90 meters
ADMIN to MEDIA 75 meters
ADMIN to FOOD 50 meters
DECORATORS to FOOD 65 meters
DECORATORS to MEDIA 50 meters
FOOD to MEDIA 45 meters
DELHI Head Office to MUMBAI Campus 1475 KM
8
BUILDING NO OF COMPUTERS
ADMIN 110
DECORATORS 75
MEDIA 12
FOOD 20
I. Suggest the most appropriate location of the server inside the MUMBAI
campus (out of the 4 buildings). Justify your answer.
II. Draw the cable layout to efficiently connect various buildings within the
MUMBAI campus.
III. Which hardware device will you suggest to connect all the computers within
each building?
IV. Which of the following will you suggest to establish online face-to-face
communication between the people in the Admin Office of the MUMBAI
campus and the DELHI Head Office?
a. Cable TV b. Email c. Video Conferencing d. Text Chat
V. A) What type of network (out of PAN, LAN, MAN, WAN) will be set up in
eachof the following cases?
i. The Mumbai campus gets connected with the Head Quarter in Delhi
OR
ii, The computers connected in the MUMBAI campus