QP-1 CS
QP-1 CS
QP-1 CS
ु म ांक/ROLL NO सेट/SET : 01
elif Text[i].islower():
L=L+Text[i].upper()
elif Text[i].isdigit():
L=L+(Text[i]*2)
else:
L=L+'#'
print(L)
(A)hAPPY#HOUR1122#33
(B)Happy#hOUR12#3
(C)hAPPY#HOUR112233
(D)Happy Hour11 22 33 #
3 Consider the given expression: 1
17%5==2 and 4%2>0 or 15//2==7.5
Which of the following will be correct output if the given expression is evaluated?
(a)True (b) False (c)None (d)Null
4 Select the correct output of the code: 1
s = "Question paper 2022-23"
s= s.split('2')
print(s)
a. ['Question paper ', '0', '', '-', '3']
b. ('Question paper ', '0', '', '-', '3')
c. ['Question paper ', '0', '2', '', '-', '3']
d. ('Question paper ', '0', '2', '', '-', '3')
5 What will be the output of following code if 1
a = “abcde”
a [1:1 ] == a [1:2]
type (a[1:1]) == type (a[1:2])
6 Select the correct output of the code: 1
a = "foobar"
a = a.partition("o")
print(a)
(a) ["fo","","bar"]
(b) ["f","oo","bar"]
(c) ["f","o","bar"]
(d) ("f","o","obar")
7 State whether the following statement is True or False: 1
An exception may be raised even if the program is syntactically correct.
8 1
Identify the output of the following python code: 1
D={1:"one",2:"two", 3:"three"}
L=[]
for k,v in D.items():
if 'o' in v:
L.append(k)
print(L)
(a) (10,20) (b) (10,) (c) (10) (d) All are tuples.
10 1
Which of the following is the correct usage for tell() of a file
object,………………….?
1
a) It places the file pointer at the desired offset in a file.
b) It returns the byte position of the file pointer as an integer.
c) It returns the entire content of the file.
d) It tells the details about the file.
11 What will be the output of the following Python code snippet? 1
d1 = {"john":40, "peter":45}
d2 = {"john":466, "peter":45}
d1 > d2
a. True b. False
c. Error d. None
12 Consider the code given below: 1
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
13 Which of the following commands is not a DDL command? 1
1
(a) DROP (b) DELETE (c) CREATE (d) ALTER
14 Which of the following keywords will you use in the following query to 1
display the unique values of the column dept_name?
SELECT --------------------- dept_name FROM Company;
(a)All (b) key (c) Distinct (d) Name
15 What is the maximum width of numeric value in data type int of MySQL. 1
a. 10 digits b. 11 digits
c. 9 digits d. 12 digits
16 SUM(), AVG() and COUNT() are examples of functions. 1
1
a) single row functions
b) aggregate functions
c) math function
d) date function
17 is a standard mail protocol used to receive emails from a remote server 1
to a local email client.
18 Pawan wants to transfer files and photos from laptop to his mobile. He uses 1
Bluetooth Technology to connect two devices. Which type of network will be
formed in this case.
a. PAN b. LAN
c. MAN d. WAN
19 Fill in the blank: 1
In case of switching, message is send in stored and forward manner from
sender to receiver.
Q20 and 21 are ASSERTION AND REASONING based questions. Mark the
correct choice as
(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
20 Assertion (A): The default argument values in Python functions can be mutable 1
types like lists and dictionaries.
Reason (R): Mutable default arguments retain their state across function calls,
which can lead to unexpected behaviour.
21 Assertion (A): The HAVING clause in MySQL is used to filter records after the 1
GROUP BY operation.
Reason (R): The WHERE clause filters records before grouping, while HAVING
allows for conditions on aggregated data.
SECTION
B
22 Write difference between mutable and immutable property, Explain it with 2
its example.
23 Predict the output of the Python 2
code given below:
T = (9,18,27,36,45,54)
L=list(T)
L1 = [ ]
for i in L:
if i%6==0:
L1.append(i)
T1 = tuple(L1)
print(T1)
24 Write the Python statement for each of the following tasks using 2
BUILT-IN functions/methods only:
(i) To insert an element 400 at the fourth position, in the list L1.
(ii) To check whether a string named, message ends with a full stop/
period or not.
OR
OR
(i) Define the term baud with respect to networks.
(ii) How is http different from https?
SECTION C
29 Write a user – defined function countH() in Python that displays the number 3
of lines starting with ‘H’ in the file ‘Para.txt”. Example , if the file contains:
Whose woods these are I think I know.
His house is in the village though;
He will not see me stopping here
To watch his woods fill up with snow.
Output: The line count should be 2.
OR
Write a function countmy() in Python to read the text file “DATA.TXT” and
count the number of times “my” occurs in the file. For example , if the file
“DATA.TXT” contains –
“This is my website. I have displayed my preference in the CHOICE
section.” The countmy( ) function should display the output as:
“my occurs 2 times”
30 3
Aalam has created a list, L containing marks of 10 students. Write a
program, with separate user defined function to perform the following
operation:
3
PUSH()- Traverse the content of the List, L and push all the odd marks into
the stack,S.
31 3
Consider the table ACTIVITY given below:
ACODE ACTIVITYNA PARTICIP PRIZEMONEY SCHEDULED
ME ANTS TE
NUM
1001 Relay Name 16 10000 2004-01-23
1002 High Jump 10 12000 2003-12-12
1003 Shot Put 12 8000 2004-02-14
1005 Long Jump 12 9000 2004-01-01
1008 Discuss Throw 10 15000 2004-03-19
Based on the given table, write SQL queries for the following:
(i) Display the details of all activities in which prize money is more than
9000 (including 9000)
(ii) Increase the prize money by 5% of those activities whose schedule
date is after 1st of March 2023.
(iii) Delete the record of activity where participants are less than 12.
SECTION D
32 You have learnt how to use math module in Class XI. Write a code where you 4
use the wrong number of arguments for a method (say sqrt() or pow()). Use
the exception handling process to catch the ValueError exception.
33 Write a python program to create a csv file dvd.csv and write 10 records in it 4
Dvdid, dvd name, qty, price. Display those dvd details whose dvd price is
more than 25.
34 Consider the following tables and answer the questions a and b: 1*4=4
Table: Garment
GCode GNam e Rate Qty CCode