0% found this document useful (0 votes)
38 views75 pages

SEC A (3)

The document contains a series of questions and exercises related to computer science concepts, programming in Python, and SQL database management. It includes true/false statements, multiple-choice questions, and code snippets for students to analyze and predict outputs. The questions are designed for a Class XII curriculum under the CBSE board and cover various topics in computer science.

Uploaded by

amandeep11092006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views75 pages

SEC A (3)

The document contains a series of questions and exercises related to computer science concepts, programming in Python, and SQL database management. It includes true/false statements, multiple-choice questions, and code snippets for students to analyze and predict outputs. The questions are designed for a Class XII curriculum under the CBSE board and cover various topics in computer science.

Uploaded by

amandeep11092006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 75

e-Tech CBSE Classes

XII ( Comp.Sci)

SEC-A
1 State True or False 1
“If a loop terminates using break statement, loop else will not execute”
2 BETWEEN clause in MySQL cannot be used for 1
a) Integer Fields b) Varchar fields
c) Date Fields d) None of these
3 What will be the output of the following code snippet? 1
a=10
b=20
c=-5
a,b,a = a+c,b-c,b+c
print(a,b,c)
a) 5 25 -5 b) 5 25 25
c) 15 25 -5 d) 5 25 15
4 What is the result of the following code in python? 1
S="ComputerExam"
print(S[2]+S[-4]+S[1:-7])
a) mEomput b) mEompu
c) MCompu d) mEerExam
5 command is used to add a new column in an existing table in MySQL? 1
6 The IP (Internet Protocol) of TCP/IP transmits packets over Internet using _ 1
switching.
a) Circuit b) Message
c) Packet d) All of the above
7 Consider a list L = [5, 10, 15, 20], which of the following will result in an error. 1
a) L[0] += 3 b) L += 3 c) L *= 3 d) L[1] = 45
8 Which of the following is not true about dictionary ? 1
a) More than one key is not allowed
b) Keys must be immutable

Page 1 of 8
c) Values must be immutable
d) When duplicate keys encountered, the last assignment wins
9 Which of the following statements 1 to 4 will give the same output? 1
tup = (1,2,3,4,5)
print(tup[:-1]) #Statement 1
print(tup[0:5]) #Statement 2
print(tup[0:4]) #Statement 3
print(tup[-4:]) #Statement 4
a) Statements 1 and 2 b) Statements 2 and 4
c) Statements 2 and 5 d) Statements 1 and 3
10 What possible outputs(s) will be obtained when the following code is 1
executed?
import random
VALUES = [10, 20, 30, 40, 50, 60, 70, 80]
BEGIN = random.randint(1,3)
LAST = random.randint(BEGIN, 4)
for x in range(BEGIN, LAST+1):
print(VALUES[x], end = "-")
a) 30-40-50- b) 10-20-30-40-
c) 30-40-50-60- d) 30-40-50-60-70-
11 Which of the following command is used to move the file pointer 2 bytes ahead from the 1
current position in the file stream named fp?
a) fp.seek(2, 1) b) fp.seek(-2, 0)
c) fp.seek(-2, 2) d) fp.seek(2, -2)
12 Predict the output of the following code: 1
def ChangeLists(M , N):
M[0] = 100
N = [2, 3]
L1 = [-1, -2]
L2 = [10, 20]
ChangeLists(L1, L2)
print(L1[0],"#", L2[0])
a) -1 # 10 b) 100 # 10
c) 100 # 2 c) -1 # 2
13 Which of the following is not a function of csv module? 1
a) readline() b) writerow()
c) reader() d) writer()
14 State True or False 1
“A table in RDBMS can have more than one Primary Keys”
15 COUNT(*) function in MySQL counts the total number of in a table. 1
a) Rows b) Columns
c) Null values of column d) Null values of a row
16 Which of the following is not a method for fetching records from MySQL table using Python 1
interface?
a) fetchone() b) fetchrows()
c) fetchall() d) fetchmany()

Page 2 of 8
Q17 and 18 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
17 Assertion (A):- Text file stores information in ASCII or UNICODE characters. 1
Reasoning (R):- In text file there is no delimiter(EOL) for a line.
18 Assertion (A):- HAVING clause is used with aggregate functions in SQL. 1
Reasoning (R):- WHERE clause places condition on individual rows.

SEC-A
1 State True or False: 1
“Python is a case sensitive language i.e. upper and lower cases are treated differently.”

2 In a table in MYSQL database, an attribute Aof datatype char(20)has the value 1


“Rehaan”. The attribute B of datatype varchar(20) has value “Fatima”. How many
characters are occupied by attribute A and attribute B?
a. 20,6 b. 6,20
c. 9,6 d. 6,9

3 What will be the output of the following statement: 1


print(5-2**2**2+99//11)
a. -20 b. -2.0
c. -2 d. Error
4 Select the correct output of the code: 1
for i in "QUITE":
print(i.lower(), end="#")
a. q#u#i#t#e# b. ['quite#’] c. ['quite'] # d. [‘q’]#[‘u’]#[‘i’]#[‘t’]#[‘e’]#
5 In MYSQL database, if a table, Workshas degree 3 and cardinality 3, andanother table, 1
Jobs has degree 3 and cardinality 3, what will be the degree and cardinality of the
Cartesian product of Worksand Jobs?
a. 9,9 b. 6,6
c. 9,6 d. 6,9 [1]

6 A set of rules that governs data communication in computer networks is called … 1


a. Standard b. protocol c. Stack d. none of these

Page 3 of 8
7 Given the followingdictionaries 1

dict_exam={"Exam":"AISSCE", "Year":2023} dict_result={"Total":500,


"Pass_Marks":165}

Which statement will merge the contents of both dictionaries?


a. dict_exam.update(dict_result)
b. dict_exam + dict_result
c. dict_exam.add(dict_result)
d. dict_exam.merge(dict_result)
8 Consider the statements given below and then choose the correct outputfrom the 1
given options:
pride="#Azadi Ka Amrut@75"
print(pride[-2:2:-2])
Options

a. 7TRAa d
b. 7tRAa d
c. 7TrAa d
d. 7trAa d
9 Which of the following statement(s) would give an error after executing the 1
Following code?
S="Welcome to class XII" # Statement 1
print(S) # Statement 2
S="Thank you" # Statement 3
S[0]= '@' # Statement 4
S=S+ "Thank you" # Statement 5

a. Statement 3 b. Statement 4
c. Statement 5 d. Statement 4 and 5

10 What will be the output of the following code? 1

a. Delhi#Mumbai#Chennai#Kolkata# b. Mumbai#Chennai#Kolkata#Mumbai#
c. Mumbai# Mumbai #Mumbai # Delhi# d. Mumbai# Mumbai #Chennai # Mumbai

[2]

Page 4 of 8
11 Fill in the blank: 1
The modem at the received computer end acts as a .
a. Model
b. Modulator
c. Demodulator
d. Convertor

12 Consider the code given below: 1

Which of the following statements should be given in the blank for#Missing Statement,
if the output produced is 110?
Options:
a. global a
b. global b=100
c. global b
d. global a=100
13 State whether True or False : 1
When you connect your mobile phone with your laptop, the network formed is called as
LAN.
14 Fill in the blank: 1

is a candidate key which is not selected as a primary key.


a. Primary Key b. Foreign Key c. Candidate Key d. Alternate Key

15 Fill in the blank: 1

is the transfer of small pieces of data across various networks.

16 The correct syntax of seek()is: 1


a. file_object.seek(offset [, reference_point])
b. seek(offset [, reference_point])
c. seek(offset, file_object)
d. seek.file_object(offset) [3] 5 of 8
Page
Q17 and 18 are ASSERTION AND REASONING based questions. Markthe 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
17 Assertion (A):- Dictionaries are mutables.. 1
Reasoning (R):- The contents of the dictionary can be changed after it has been created

18 Assertion (A):- If the arguments in a function call statement match the number 1
and order of arguments as defined in the function definition, such argumentsare called
positional arguments.
Reasoning (R):- During a function call, the argument list first contains default
argument(s) followed by positional argument(s).

SEC-A

SECTION A
1. Assigna tuplecontaining anInteger? (1)

2. Whichofthefollowing data typein Python supports concatenation? (1)


a)int b)float c)bool d)str
3. Whatwillbeoutputofthefollowingcode: (1)
d1={1:2,3:4,5:6}
d2=d1.popitem()
print(d2)
a){1:2} b){5:6} c)(1,2) d)(5,6)

4. Thecorrectoutputofthe givenexpressionis: (1)


TrueandnotFalseorFalse
(a)False(b)True(c)None (d)Null

5. Fillintheblank: (1)
Commandis used toadd anewcolumn in atableinSQL.
a)update b)remove c)alter d)drop
6. Consider the Python statement: f.seek(10, 1) (1)
Choosethecorrectstatementfromthefollowing:

(a) Filepointerwillmove10byteinforwarddirectionfrombeginningofthefile
(b) Filepointerwillmove10byteinforwarddirectionfromendofthefile
(c) Filepointerwillmove10 byteinforwarddirectionfromcurrentlocation
(d) Filepointerwillmove10byteinbackwarddirectionfromcurrentlocation
7. ChoosecorrectSQLquerywhichisexpectedtodeleteallrowsofatableempwithout deleting its (1)
structure.
a) DELETETABLE;
b) DROP TABLE emp;
c) REMOVETABLemp;
d) DELETEFROMemp;
8. Whichofthe following isNOT a DMLCommand? (1)
(a)Insert (b)Update (c)Drop (d)Delete
Page 6 of 8
9. Selectthecorrectoutputothecode: (1)
a="Year2022atallthe
best"a=a.split('a')
b=a[0]+"-"+a[1]+"-"+a[3]
print (b)

a) Year–0-atAllthebest
b) Ye-r2022-llthebest
c) Year–022-atAllthebest
d) Year–0-atallthebest

10. Whichofthefollowingstatement(s)wouldgiveanerrorduringexecution?
S="Lucknow is the Capital of UP " #Statement1

print(S) #Statement2

S[4]='$’ #Statement3

S="Thankyou" #Statement4

S=S+"Thankyou" #Statement5

(a)Statement3 (b)Statement4 (c)Statement5 (d)Statement4and5

11. Whichofthe followingfunctionreturns alistdatatype? (1)


a)d=f.read() b) d=f.read(10) c)d=f.readline() d)d=f.readlines()

12. Selectthecorrectstatement,withreferencetoSQL: (1)


a) AggregatefunctionsignoreNULL
b) AggregatefunctionsconsiderNULLaszeroorFalse
c) AggregatefunctionstreatNULLasablankstring
d) NULLcanbewrittenas'NULL'also.

13. Fillinthe blank: (1)


The isamailprotocolusedtoretrievemailfromaremoteservertoalocal email
client.
(a)VoIP (b)FTP (c)POP3 (d)HTTP
14. Whatwillbethevalueofywhenfollowingexpressionbeevaluatedin Python? (1)
x=10.0
y=(x<100.0)andx>=10
(a)110(b)False (c)Error (d)True

15. All aggregate functions except ignorenullvaluesintheirinputcollection. (1)


(a) Count(attribute)
(b) Count(*)
(c) Avg
(d) Sum
16. WhichofthefollowingmethodisusedtocreateaconnectionbetweentheMySQL database (1)
and Python?
a)(a)connector ( ) (b)connect ( ) (c)con() (d)cont()

Page 7 of 8
Q17and18areASSERTIONANDREASONINGbasedquestions.Markthecorrect choice as
a) BothAand Raretrue andR isthecorrectexplanationforA
b) BothA andR aretrue andRis notthecorrectexplanationfor
c) Ais Truebut R isFalse
d) Ais false butR isTrue

17. Assertion(A):-Thedefaultarguments canbeskipped inthefunctioncall. (1)


Reason(R):-Thefunctionargumentwilltakethedefaultvaluesevenifthevaluesare supplied in
the function call

18. Assertion(A):Atuplecanbeconcatenatedtoalist,butalistcannotbeconcatenatedtoa tuple. (1)


Reason(R):Listsaremutableand tuplesare immutableinPython.

SECTION – A
Q1. State True or False (1)
"In Python, data type of a variable depends on its value"
Q2. The correct definition of column ‘alias’ is (1)
a. A permanent new name of column
b. A new column of a table
c. A view of existing column with different name
d. A column which is recently deleted
Q3 What will be the output of the following python expression? print(2**3**2) (1)
a. 64 b. 256 c. 512 d. 32
Q4. What will be the output of the following python dictionary operation?data (1)
= {'A':2000, 'B':2500, 'C':3000, 'A':4000}
print(data)
a. {'A':2000, 'B':2500, 'C':3000, 'A':4000}
b. {'A':2000, 'B':2500, 'C':3000}
c. {'A':4000, 'B':2500, 'C':3000}
d. It will generate an error.

Q5. In MYSQL database, if a table, Alpha has degree 5 and cardinality 3, and another table, Beta (1)
has degree 3 and cardinality 5, what will be the degree and cardinality of the Cartesian product of
Alpha and Beta?
a. 5,3 b. 8,15 c. 3,5 d. 15,8

Q6. Identify the device on the network which is responsible for forwarding data from one device (1)
to another
a. NIC b. Router c. RJ45 d. Repeater

Q7. Choose the most correct statement among the following – (1)

Page 1 of 10
a. a dictionary is a sequential set of elements
b. a dictionary is a set of key-value pairs
c. a dictionary is a sequential collection of elements key-value pairs
d. a dictionary is a non-sequential collection of elements
Q8. Select the correct output of the code: a (1)
= "Year 2024 at all the best" a
= a.split('a')
b = a[0] + "-" + a[1] + "-" + a[3]
print (b)

a. Year – 0- at All the best


b. Ye-r 2024 -ll the best
c. Year – 024- at All the best
d. Year – 0- at all the best

Q9. Which of the following statement(s) would give an error during execution? (1)
S=["CBSE"] # Statement 1
S+="Delhi" # Statement 2
S[0]= '@' # Statement 3
S=S+"Thank
you" # Statement 4
a) Statement 1b) Statement 2 c) Statement 3 d) Statement 4
Q10. Give the output: (1)
dic1={‘r’:’red’,’g’:’green’,’b’:’blue’}
for i in dic1:
print
(i,end=’’)
a. rgb
b. RGB
c. RBG
d. rbg
Q11. Which function is used to display the unique values of a column of a table? (1)
a. sum()
b. unique()
c. distinct()
d. return()
Q12. Select the correct output of the code: for (1)
i in "QUITE":
print([i.lower()], end= "#")
a. q#u#i#t#e#
b. [‘quite#’]
c. ['q']#['u']#['i']#['t']#['e']#
d. [‘quite’] #

Q13. The statement which is used to get the number of rows fetched by execute() method of (1)
cursor:

Page 2 of 10
a. cursor.rowcount b. cursor.rowscount()
c. cursor.allrows() d. cursor.countrows()
Q14. Select the correct statement, with reference to SQL: (1)
a. Aggregate functions ignore NULL
b. Aggregate functions consider NULL as zero or False
c. Aggregate functions treat NULL as a blank string
d.NULL can be written as 'NULL' also.
Q15. is a communication protocol responsible to control thetransmission of data over a (1)
network.
a. TCP (b) SMTP (c) PPP (d)HTTP

Q16. Which method is used to move the file pointer to a specified position. (1)
a. tell()
b. seek()
c. seekg()
d. tellg()

Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct choice as (1)
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
C. A is True but R is False
d. A is false but R is True
Q17. Assertion (A):- The number of actual parameters in a function call may not be equal to the (1)
number of formal parameters of the function.
Reasoning (R):- During a function call, it is optional to pass the values to default
parameters.

Q18. Assertion (A): A tuple can be concatenated to a list, but a list cannot be concatenated to a (1)
tuple.
Reason (R): Lists are mutable and tuples are immutable in Python.

SECTION
A
1. State True or False: 1
Python Keywords cannot be variables.
2. What will be the datatype of d, if d = (15) ? 1
(a) int (b) tuple (c) list (d) string
3. What will be the output of the following expressions: a) 2**3**2 b) (2**3)**2 1
a) a: 512 b. 64
b) a: 64 b. 512
c) a: 1024 b. 64
d) a: 64 b. 64
4. Table A has 3 rows and 4 columns and Table B has 5 rows and 6 columns. What 1
is the degree and cardinality of Cartesian product of A and B?
a) Degree is 15 and CardinalityPage
is 15
3 of 10
b) Degree is 10 and Cardinality is 10
c) Degree is 10 and Cardinality is 15
d) Degree is 15 and Cardinality is 10
5. What will be output of the following code: 1
d1={1:2,3:4,5:6}
d2=d1.get(3,5)
print(d2)
a) 3 b) 4 c) 5 d) Error
6. Consider the given expression: 1
3 and 5<15 or 3<13 and not 12<2
Which of the following is the correct value of the expression?
a) True b) False c) None d) NULL
7. What will be the output of the following code:- 1
s="one two three"
s=s.split(
) print(s)
a) ['one', 'two', 'three'] b) ('one', 'two', 'three') c) [one, two, three]
d) None
8. Hanu wants to connect 10 computers in her office. What is the type of network? 1
a) LAN b) WAN c) PAN d) FAN
9. Consider the statements given below and then choose the correct output 1
from the given options:
s=”KVS@CBSE 2023”
print(s[-2:2:-2])
a) 22EB@ b) 2023@kvs c) KVS@2023 d) 30 SCS
10. Which of the following MySQL command/clause is used to sort the data in a table 1
a) SORT b) ASCENDING c) ORDER BY d) DROP

Page 4 of 10
11. Which of the following device is responsible for signal boosting 1
a) Repeater b) Router c) Switch d) Modem
12. function returns the current position of file pointer 1
a) tell() b) seek() c) first() d) last()
13. In the URL www.kvsangathan.nic.in , tells the type of website 1
a) www b) .in c) kvsangathan d) .nic
14. Which of the following is not an Aggregate function. 1
a) COUNT b) MIN c) MAX d) DISTINCT
15. What will be the output of the following code: 1
t=(2,3,[4,5,6],7)
t[2]=4
print(t)
a) (2,3,4,7) b) (2,3,[4],7) c) Type error d) None
16. What possible output(s) are expected to be displayed on screen at the time of 1
execution of the program from the following code?
import random
points=[30,50,20,40,45]
begin=random.randint(1,3)
last=random.randint(2,4)
for c in range(begin,last+1):
print(points[c],"#",end=’’)
(a) 20#50#30# (b) 20#40#45 (c) 50#20#40# (d) both (b) and (c)
Q 17 and 18 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
17. Assertion (A): CSV module allows to write a single record into each row in CSV 1
file using write row() function.
Reason (R): The write row() function creates header row in csv file by default.
18. Assertion (A):- In Python, statement return [expression] exits a function. 1
Reasoning (R):- Return statement passes back an expression to the caller. A
return statement with no arguments is the same as return None.

Q. SECTIONA Marks
No.
1. State True or False 1
“Variable declaration is implicit in Python”
2. Which SQL command is used to change some values in existing rows? 1
a) update b) insert c) alter d) order
3. Consider the following expression : 5+2**6<9+2-16//8 1
Which of the following will be correct output if the given expression is evaluated?
(a) 127 (b) True (c) False (d) Invalid expression
4. Which of the following refers to mathematical function? 1
a) sqrt b) rhombus c) add d) rhombus
1
5. In MYSQL database, if a table, Alpha has degree 5 and cardinality 3, and another table, Beta has degree 1
3 and cardinality 5, what will be the degree and cardinality of the Cartesian product of Alpha and Beta?
a) 5,3 b) 8,15 c) 3,5 d) 15,8

6. ……………. Protocol is used to send the email to another email user. 1


a) FTP b) POP c) IMAP d) SMTP
7. What will be the output of the following Python code snippet? 1

a) 1 b) 2 c) 4 d) Error, the keys can’t be a mixture of letters and numbers


8. Select the correct output of the code: 1

2
(a)COMPUTER-students-ARE-very-SMART (b) COMPUTER-STUDENTS-ARE-very-SMART
(c) computer-students-are-very-SMART (d) COMPUTER-STUDENTS-ARE-VERY-SMART
9. Which of the following statement(s) would give an error during execution ofthe 1
following code?
tup = (60,120,25,40,70,99)
print(tup) #Statement 1
tup [4] =80#Statement 2
print (tup [3] +50) #Statement 3
print(min(tup)) #Statement 4
Options:
a. Statement 1 b. Statement 2 c. Statement 3 d. Statement 4
10. What possible outputs(s) will be obtained when the following code is executed? 1

a. b.
RAMAN** SHIVAJI*
SHIVAJI** *
TAGORE** SHIVAJI**TAGORE**
c. d.
SHIVAJI** SHIVAJI** ASHOKA*
TAGORE** TAGORE** *
SHIVAJI*SHIVAJI*
TAGORE* TAGORE* TAGORE*
11. Fill in the blank: 1
The modem at the sender’s computer end acts as a .
a. Modelb. Modulatorc. Demodulatord. Convertor
12. What will be the output of the following Python code? 1

a) 65 b) error c) 75 d) 85
13. State True or False 1
An try block may have more than except blocks to handle exception.
14. Select correct collection of DDL Command? 1
3
(a) CREATE, DELETE, ALTER, MODIFY (b) CREATE, DROP, ALTER, UPDATE
(c) CREATE, DROP, ALTER, TRUNCATE (d) CREATE, DELETE, ALTER, UPDATE
15. A is a set of rules that governs data communication. 1

16. Which statement is used to retrieve the current position within the file: 1
a) fp.seek() b) fp.tell() c) fp.loc d) fp.pos
Q17 and 18 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
17. Assertion(A): List is an immutable data type 1
Reasoning(R): When an attempt is made to update the value of an immutable variable, the oldvariable is
destroyed and a new variable iscreated by the same name in memory.
18. Assertion (A): A function is a block of organized and reusable code that is usedto perform a single 1
related action.
Reason (R): Function provides better modularity for your application and ahigh degree of code
reusability.

खं ड / SECTION-A
Ůʲ सं Ůʲ / Question अं क /
Q. No. Marks
1. State True or False 1
“break keyword skips remaining part of an iteration in a loop and compiler goes to
starting of the loop and executes again”
2. Find the valid keyword from the following? 1
a) Student-Name b) False c) 3rdName d) P_no
3. What will be the output for the following Python statement? 1
X={‘Sunil’:190, ‘Raju’:10, ‘Karambir’:72, ‘Jeevan’:115}
print(‘Jeevan’ in X, 190 in X, sep=”#”)
(a)True#False (b) True#True
(c) False#True (d) False#False
4. Consider the given expression: 1
True and False or not True
Which of the following will be correct output if the given expression is evaluated?
(a) True (b) False
(b) (c) NONE (d) NULL
5. Select the correct output of the code: 1
a = "Python! is amazing!"a
= a.split('!')
b = a[0] + "." + a[1] + "." + a[2]
print (b)
(a) Python!. is amazing!. (b) Python. is amazing.
(c) Python. ! is amazing.! (d) will show error
6. Which of the following mode in file opening statement overwrite the existing content? 1
(a) a+ (b) r+
(c) w+ (d) None of the above

1
7. The attribute which have properties to be as referential key is known as. 1
(a) foreign key (b)alternate key
(c) candidate key (d) Both (a) and (c)
8. Which command is used to change some values in existing rows? 1
(a) CHANGE (b) MODIFY
(b) (c) ALTER (d) UPDATE
9. Which of the following statement(s) would give an error after executing thefollowing 1
code?
Q="Humanity is the best quality" # Statement1
print(Q) # Statement2
Q="Indeed.” # Statement3
Q[0]= '#' # Statement4
Q=Q+"It is." # Statement5
(a) Statement 3 (b) Statement 4 (c)Statement 5 (d)Statement 4 and 5
10. p=150 1
def fn(q):
_ #missing statement
p=p+q
fn(50) print(p)
Which of the following statements should be given in the blank for #missingstatement if
the output produced is 200
(a) global p=150 (b) global p
(c) p=150 (d) globalq

11. Which function is used to split a line of string in list of words? 1


(a)split( ) (b) splt( )
(c) split_line( ) (d) all of these
12. What possible output(s) will be obtained when the following code is executed import 1
random
k=random.randint(1,3)
fruits=[‘mango’, ‘banana’, ‘grapes’, ‘water melon’, ‘papaya’] for
j in range(k):
print(j, end=“*”)
(a) mango*banana*grapes (b) banana*grapes
(c) banana*grapes*watermelon (d) mango*grapes*papaya
13. Fill in the blank: 1
is a communication protocol responsible for sending emails.
(a) TCP (b) SMTP (c) PPP (d)HTTP
14. What will be the ouput when following expression be evaluated in Python? print(21.5 // 4 1
+ (8 + 3.0))
(a) 16 (b)14.0 (c) 15 (d) 15.5
15. Which of the following functions other than close() writes the buffer data to file 1
(a) push() (b) write() (c) writeBuffer() (d) flush()
16. To get counting of the returned rows, you may use……………. 1
(a) cursor.rowcount (b) cursor.count
(c) cursor.countrecords() (d) cursor.manyrecords()

2
Q17 and 18 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
17. Assertion (A):- If the arguments in function call statement are provided in the format 1
parameter=argument, it is called keyword arguments.
Reasoning (R):- During a function call, the argument list first contain keywordargument(s)
followed by positional argument(s).
18. Assertion (A): CSV (Comma Separated Values) is a file format for data storage with one 1
record on each line and each field is separated by comma.
Reason (R): The format is used to share data between cross platform as text editors are

Q.NO QUESTION MARKS

SECTION - A
1 Which of the following is a keyword in Python?
a) true b) For c) pre-board d) False 1

2 What will be the output for the following Python statement?


print(20//3*2+(35//7.0))
1
a) 17.0 b) 17 c) 8.5 d) 8

3 In MYSQL database, if a table, BOOK has degree 8 and cardinality 7, and


another table, SALE has degree 4 and cardinality 7, what will be the degree and
1
cardinality of the Cartesian product of BOOK and SALE ?
a) 32 , 49 b) 12, 49 c) 12 ,14 d) 32,14
4 What is “ C “ stands in TCP/IP ?
1
a) Common b) Centre c)Control d) Coordinate
5 What is printed by the following statements?
ANIMAL={"dog":10,"tiger":5,"elephant":15,"Cow":3}
1
print("Tiger" not in ANIMAL)
a) True b)False c)Error d) None
6 Consider the following statements and choose the correct output from the given
options :
EXAM="COMPUTER SCIENCE" 1
print(EXAM[:12:-2])
a) EN b) CI c)SCIENCE d) ENCE
7 What will be the output of the following code ?
1
Tuple1=(10,)

3
Tuple2=Tuple1*2
print(Tuple2)
a) 20 b) (20,) c) (10,10) d) Error
8 Fill in the blanks:
The SQL keyword ------------------is used in SQL expression to select records 1
based on patterns
9 What possible outcome will be produced when the following code is executed?
import random
value=random.randint(0,3)
fruit=["APPLE","ORANGE","MANGO","GRAPE"]
for i in range(value):
print(fruit[i],end='##')
print()

a) APPLE##
1
b) APPLE#
ORANGE##

c) APPLE## ORANGE##

d) ORANGE##
MANGO##
APPLE##
10 Select the network device from the following, which connects, networks with
different protocols 1
a) Bridge b)Gateway c)Hub d) Router
11 State whether the following statement is TRUE or FALSE :
1
The value of the expression 4/3*(2-1) and 4/(3*(2-1)) is the same
12 In the relational models , cardinality actually refers to --------------
a) Number of tuples b) Number of attributes 1
c) Number of tables d) Number of constraints
13 Data structure STACK is also known as ------------ list
a)First In First Out b) First In Last Out 1
c)Last In First Out d) Last In Last Out
14 Which function is used to write a list of strings in a file?
1
a) writeline( ) b) writelines( ) c) write() d) writeall( )
15 Which of the following is NOT a guided communication medium?
a) Twisted pair cable b) Microwave 1
c) Coaxial cable d) Optical fibre
16 Which of the following function header is correct?
a) def fun(a=1,b):
b) def fun(a=1,b,c=2): 1
c) def fun(a=1,b=1,c=2):
d) def fun(a=1,b=1,c=2,d):
Q17 and 18 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

4
(d) A is false but R is True
17 Assertion ( A): In SQL, the aggregate function avg() calculates the average
value on a set of values and produces a single result.
Reason ( R): The aggregate functions are used to perform some fundamental 1
arithmetic tasks such as min(), max(), sum() etc

18 Assertion(A): Python overwrites an existing file or creates a non-


existing file when we open a file with ‘w’ mode.
1
Reason(R): a+ mode is used only for writing operations

SECTION A

(Each question carries one mark)

1. What will be the output of the following python statement? 1


L=[3,6,9,12]
L=L+15

print(L)

(a)[3,6,9,12,15] (b) [18,21,24,27] (c) [5,3,6,9,12,15] (d) error

2. Identify the output of the following python statements 1


import random

for n in range(2,5,2):

print(random.randrange(1,n,end=’*’)

(a)1*3 (b) 2*3 (c) 1*3*4 (d)1*4

3. Which of the following is an invalid identifier? 1


(a) _123 (b) E_e12 (c) None (d) true

4. Consider the given expression: 1


7%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

5. 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')

6. Which of the following mode in file opening statement does not results in Nor generates an error if the file
Page
1
does not exist? 1
(a) r (b) r+ (c) w+ (d) None of the above

7. Which of the following commands is not a DDL command? 1


(a) DROP (b) DELETE (c) CREATE (d) ALTER

Page
2
8. Which of the following SQL statements is used to open a database named “SCHOOL”? 1
(a) CREATE DATABASE SCHOOL;
(b) USE DATABASE SCHOOL;
(c) USE SCHOOL;
(d) SHOW DATABASE SCHOOL;

9. 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) [1,2] (b) [1,3] (c)[2,3] (d)[3,1]

10.A relation can have only one key and one or more than one keys. 1
(a) PRIMARY, CANDIDATE
(b) CANDIDATE, ALTERNATE (c
)CANDIDATE ,PRIMARY
(d) ALTERNATE, CANDIDATE

11. 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.

12. What are the minimum number of attributes required to create a table in MySQL? 1
(a) 1 (b) 2 (c) 0 (d)3

13. is a standard mail protocol used to receive emails from a remote server to a local email client. 1
(a) SMTP (b) POP (c) HTTP (d) FTP

14. Which of the following is not a tuple in python? 1


(a) (10,20) (b) (10,) (c) (10) (d) All are tuples.

15. SUM(), ANG() and COUNT() are examples of functions. 1


(a) single row functions
(b) multiple row functions
(c) math function
(d) date function

16. What are the mandatory arguments which are required to connect a MySQL database to python? 1
(a) username, password, hostname, database name
(b) username, password, hostname
(c) username, password, hostname, port
(d) username, password, hostname, database name

Q17 and 18 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
Page 1of75
17. Assertion: The default value of an argument will be used inside a function if we do not pass a value to that
argument at the time of the function call. 1
Reason: the default arguments are optional during the function call. It overrides the default value if we
provide a value to the default arguments during function calls.

18. Assertion: Pickling is the process by which a Python object is converted to a byte stream. 1
Reason: load() method is used to write the objects in a binary file. dump() method is used to read data
from a binary file.

SECTION A
1 IdentifytheinvalidPython statementfromthefollowing. 1
(a)_b=1 (b)b1=1 (c)b_=1 (d)1 = _b

2 Identifythevalid arithmeticoperatorinPythonfromthefollowing. 1
(a)// (b) < (c) or (d) <>

3 If Statement in Python is 1
(a)looping statement (b)selectionstatement (c)iterative (d) sequential

4 PredictthecorrectoutputofthefollowingPythonstatement– print(4 + 1
3**3/2)

(a)8 (b)9 (c)8.0 (d)17.5

5 Choosethemostcorrectstatementamongthefollowing– 1

(a) adictionary is asequential set of elements


(b) adictionaryisasetof key-value pairs
(c) adictionary is asequential collection ofelements key-value pairs
(d) adictionaryisanon-sequentialcollectionofelements

6 Considerthestringstate=“Jharkhand”.Identifytheappropriatestatement thatwilldisplaythelast five 1


characters of the string state?

(a)state [-5:] (b)state [4:] (c)state[:4] (d)state [:-4]

7 Whatwill be theoutput ofthefollowing lines ofPython code? 1

ifnotFalse:
print(10)
else:
print(20)

Page 2of75
(a)10 (b)20 (c)True (d) False

8 Consider the Python statement: f.seek(10, 1) 1


Choosethecorrectstatementfromthefollowing:

(a) filepointer willmove10 bytein forward direction from beginningof thefile


(b) filepointerwill move 10 bytein forwarddirection fromend ofthefile
(c) filepointerwill move10byte inforwarddirection fromcurrent location
(d) filepointerwillmove 10bytein backwarddirectionfromcurrent location

9 Whichofthe followingfunctionreturns alistdatatype? 1

a)d=f.read() b)d=f.read(10) c)d=f.readline() d) d=f.readlines()

10 Identifythedeviceonthenetworkwhichisresponsibleforforwardingdatafromonedeviceto another 1

(a)NIC (b) Router (c)RJ45 (d)Repeater

11 Atablehasinitially5columnsand8rows.Considerthefollowingsequenceofoperations performed 1
on the table –
i. 8rowsareadded
ii. 2columnsareadded
iii. 3rowsaredeleted
iv. 1column is added
Whatwill be thecardinalityanddegreeof thetableat theendofaboveoperations?

(a)13,8 (b) 8, 13 (c)14,5 (d) 5,8

12 Whichofthe followingconstraintis usedtoprevent aduplicatevalue inarecord? 1

(a)Empty (b)check (c)primary key (d)unique

13 The structure of the table/relation can be displayed using command. 1

(a)view (b) describe (c)show (d) select

14 Whichofthefollowingclauseisusedto removetheduplicatingrowsfromaselect statement? 1

(a)or (b) distinct (c)any (d)unique

15 Howdo youchangethefilepositionto anoffset valuefrom thestart? 1


(a)fp.seek(offset,0) (b)fp.seek(offset,1) (c)fp.seek(offset, 2) (d)Noneofthem

16 WhichofthefollowingmethodisusedtocreateaconnectionbetweentheMySQLdatabaseand Python? 1
(a)connector () (b)connect ( ) (c)con() (d) cont ()

Q17and18areASSERTION ANDREASONING basedquestions. Markthecorrectchoiceas


(a) BothA andR aretrueand Ris thecorrectexplanation for A
(b) BothAand Raretrueand Risnot thecorrect explanationfor A
(c) Ais Truebut R isFalse
(d) Ais false butR is True
Page 3of75
17 Assertion (A): The function definition calculate(a, b, c=1,d) will give error. 1
Reason(R):Allthenon-defaultargumentsmustprecedethedefaultarguments.

18 Assertion(A):CSVfilesareusedtostorethedatageneratedbyvarioussocialmediaplatforms. Reason (R): 1


CSV file can be opened with MS Excel.

SECTION A
1 IdentifytheinvalidPython statementfromthefollowing. 1
(a)_b=1 (b)b1=1 (c)b_=1 (d)1 = _b

2 Identifythevalid arithmeticoperatorinPythonfromthefollowing. 1
(a)// (b) < (c) or (d) <>

3 If Statement in Python is 1
(a)looping statement (b)selectionstatement (c)iterative (d) sequential

4 PredictthecorrectoutputofthefollowingPythonstatement– print(4 + 1
3**3/2)

(a)8 (b)9 (c)8.0 (d)17.5

5 Choosethemostcorrectstatementamongthefollowing– 1

(e) adictionary is asequential set of elements


(f) adictionaryisasetof key-value pairs
(g) adictionary is asequential collection ofelements key-value pairs
(h) adictionaryisanon-sequentialcollectionofelements

6 Considerthestringstate=“Jharkhand”.Identifytheappropriatestatement thatwilldisplaythelast five 1


characters of the string state?

(a)state [-5:] (b)state [4:] (c)state[:4] (d)state [:-4]

7 Whatwill be theoutput ofthefollowing lines ofPython code? 1

ifnotFalse:
print(10)
else:
print(20)

Page 1of75
(a)10 (b)20 (c)True (d) False

8 Consider the Python statement: f.seek(10, 1) 1


Choosethecorrectstatementfromthefollowing:

(e) filepointer willmove10 bytein forward direction from beginningof thefile


(f) filepointerwill move 10 bytein forwarddirection fromend ofthefile
(g) filepointerwill move10byte inforwarddirection fromcurrent location
(h) filepointerwillmove 10bytein backwarddirectionfromcurrent location

9 Whichofthe followingfunctionreturns alistdatatype? 1

a)d=f.read() b)d=f.read(10) c)d=f.readline() d) d=f.readlines()

10 Identifythedeviceonthenetworkwhichisresponsibleforforwardingdatafromonedeviceto another 1

(a)NIC (b) Router (c)RJ45 (d)Repeater

11 Atablehasinitially5columnsand8rows.Considerthefollowingsequenceofoperations performed 1
on the table –
v. 8rowsareadded
vi. 2columnsareadded
vii. 3rowsaredeleted
viii. 1column is added
Whatwill be thecardinalityanddegreeof thetableat theendofaboveoperations?

(a)13,8 (b) 8, 13 (c)14,5 (d) 5,8

12 Whichofthe followingconstraintis usedtoprevent aduplicatevalue inarecord? 1

(a)Empty (b)check (c)primary key (d)unique

13 The structure of the table/relation can be displayed using command. 1

(a)view (b) describe (c)show (d) select

14 Whichofthefollowingclauseisusedto removetheduplicatingrowsfromaselect statement? 1

(a)or (b) distinct (c)any (d)unique

15 Howdo youchangethefilepositionto anoffset valuefrom thestart? 1


(a)fp.seek(offset,0) (b)fp.seek(offset,1) (c)fp.seek(offset, 2) (d)Noneofthem

16 WhichofthefollowingmethodisusedtocreateaconnectionbetweentheMySQLdatabaseand Python? 1
(a)connector () (b)connect ( ) (c)con() (d) cont ()

Q17and18areASSERTION ANDREASONING basedquestions. Markthecorrectchoiceas


(e) BothA andR aretrueand Ris thecorrectexplanation for A
(f) BothAand Raretrueand Risnot thecorrect explanationfor A
(g) Ais Truebut R isFalse
(h) Ais false butR is True
Page 2of75
17 Assertion (A): The function definition calculate(a, b, c=1,d) will give error. 1
Reason(R):Allthenon-defaultargumentsmustprecedethedefaultarguments.

18 Assertion(A):CSVfilesareusedtostorethedatageneratedbyvarioussocialmediaplatforms. Reason (R): 1


CSV file can be opened with MS Excel.

SECTIONA

1 Whichofthe followingfunctions print theoutput tothe console? 1


A. Output( )
B. Print( )
C. Echo()
D. print( )

2 StateTrueorFalse: 1
“Aspecialvalue“NULL”isusedtorepresentvaluesthatareunknownto certain
attributes.”

3 Whatistheresult afterexecutingthefollowing? 1
>>>print(20/4*5+8-10)
A. 1
B. 23
C. 23.0
D. 24

4 Whichoneof thefollowingis False regardingdatatypes inPython? 1


A. Inpython,explicitdatatypeconversionispossible
B. Mutabledata types arethosethat can bechanged.
C. Immutabledatatypesarethosethatcannotbechanged.
D. Noneof the above

5 If you want to add a new column in an existingtable, which command is used. 1


Forexample,toaddacolumnbonusinatableemp,thestatementwillbegiven as:
A. ALTERtablebonusADD(empInteger);
B. CHANGEtable empADD bonus int;
C. ALTERtableempADD bonusint;
D. UPDATEtableemp ADDbonus int;

6 WhatisthesizeofIPv4address? 1
A. 32 bits
B. 64 bits
C. 64 bytes
D. 32 bytes

Page1of75
7 Whatwillbetheoutputofthefollowingpythonstatement? 1
L=[3,6,9,12]
L=L+15
print(L)
A. [3,6,9,12,15]
B. [18,21,24,27]
C. [5,3,6,9,12,15]
D. error

8 Thereturn typeof string.split()is a 1


A. string
B. List
C. Tuple
D. Dictionary

9 Given the following dictionary 1


Emp1={"salary":10000,"dept":"sales","age":24,"name":"john"}
Emp1.keys() can give the output as
A.(“salary”,‟dept”,‟age‟,‟name‟)
B.(['salary','dept','age','name'])
C.[10000,‟sales‟,24,‟john‟]
D.{„salary‟,‟dept‟,‟age‟,‟name‟}

10 import random 1
AR=[20,30,40,50,60,70]
START=random.randint(1,3)
END=random.randint(2,4)
forPinrange(START,END+1):
print (AR[P],end=”#“)

BasedontheabovecodewhatwillBethemaximumvalueofthevariables START and


END ?
A.3,4
B.4,3
C.2,4
D.4,2

11 isthedevicewhichisusedtoconvertdigitalsignalintoanalogsignaland vice- 1
versa.
A.Modulator
B.B)Modem
C.Mixture
D.Multiplexer

12 Whichkeywordisusedtoabandon thecurrentiterationofthe loop? 1


A.continue

Page2of75
B.break
C.stop
D.infinite

13 Itisraisedwhentheresultofacalculationexceedsthemaximumlimitfor numeric data 1


type.
A.OverFlowError
B.TypeError
C.ZeroDivisionError
D.NameError

14 The data types CHAR (n) and VARCHAR (n) are used to create 1
and length types of string/text fields in a database.
A.Fixed, Variable
B.Equal,Variable
C.Fixed, Equal
D.Variable,Equal

15 isastandardmailprotocolusedtoreceiveemailsfromaremoteserver to a 1
local email client.
A.SMTP
B.POP
C.HTTP
D.FTP

16 Howdoyouchangethefileposition toanoffsetvaluefromthestart? 1
A.fp.seek(offset,0)
B.fp.seek(offset,1)
C.fp.seek(offset,2)
D.noneof the mentioned

Q17and18areASSERTIONANDREASONINGbasedquestions.Markthe correct
choice as
A. BothAand Raretrue andR isthecorrectexplanationfor A
B. BothAand Raretrueand Risnot thecorrect explanationfor A
C. Ais Truebut R is False
D. Ais false butR is True

17 Assertion:Thefunctionheader‘defread(a=2,b=5,c):’isnotcorrect. Reason: 1
Non default arguments can’t follow default arguments.

18 a=(1,2,3) 1
a[0]=4
Assertion(A):Theabovecodewillresultinerror
Reason(R): a is a list, So we can change it.

Page 1 of 12 | KVS –Lucknow Region | Session 2023-24


Section – A
Q01. State True or False (1)
“Python is a platform independent, case sensitive and interpreted language”
Q02. Which of the following(s) is/are valid Identifier(s) in Python? (1)
(a) for (b) elif (c) _123 (d) None
Q03. What will be the output of the following Python code? (1)
T1=(1,2,[1,2],3)

T1[2][1]=3.5

print(T1)

(a) (1,2,[3.5,2],3) (b) (1,2,[1,3.5],3) (c) (1,2,[1,2],3.5) (d) Error Message


Q04. What will be the output of the following expression if the value of a=0, b=1 and c=2? (1)
print(a and b or not c )
(a) True (b) False (c) 1 (d) 0
Q05. What should be the output of the following code? (1)
String = “India will be a global player in the digital economy”
Str1= String.title(); Str2=Str1.split()
print(Str2[len(Str2)-1:-3:-1])
(a) [‘Digital’,’Economy’] (b) [‘The’,’Digital’,’Economy’]
(c) [‘economy’,’digital’] (d) [‘Economy’,’Digital’]
Q06. Which of the following statement is incorrect? (1)
(a) A file handle is a reference to a file on disk.

Page 1 of 12 | KVS –Lucknow Region | Session 2023-24


(b) File handle is used to read and write data to a file on disk.
(c) All the functions that you perform on a disk file can’t be performed through file handle.
(d) None of these
Q07. Fill in the blank: - (1)
command is used to add a new column into an existing table in SQL.
(a) UPDATE (b) INSERT (c) ALTER (d) CREATE
Q08. Which of the following command is a DDL command? (1)
(a) SELECT (b) GROUP BY (c) DROP (d) UNIQUE
Q09. Which of the following statement(s) would give an error after executing the following code? (1)
name_marks{'atul':88,'basab':45,'chetan':90} #Statement1
upgrade={} #Statement2
for key in name_marks.keys(): #Statement3
if (name_marks[key]>50): #Statement4
upgrade[key]=name_marks[key] #Statement5
print(upgrade) #Statement6
(a) Statement1 (b) Statement3 (c) Statement4 (d) Statement5
Q10. Fill in the blank: (1)
Number of records/ tuples/ rows in a relation or table of a database is referred to as
(a) Domain (b) Degree (c) Cardinality (d) Integrity
Q11. Which of the following statement is not true regarding opening modes of a file? (1)
(a) When you open a file for reading, if the file does not exist, an error occurs.
(b) When you open a file for writing, if the file does not exist, an error does not occur.
(c) When you open a file for appending content, if the file does not exist, an error does not occur.
(d) When you open a file for writing, if the file exists, new content added to the end of the file.
Q12. The clause is used for pattern matching in MySQL queries. (1)
(a) ALL (b) DESC (c) MATCH (d) LIKE
Q13. A specifies the distinct address for each resource on the Internet. (1)
(a) FTP (b) WWW (c) URL (d) HTTP
Q14. What will be the output of the following Python code? (1)
print(5<10 and 10<5 or 4<9 and not 3<-3)
(a) True (b) False (c) Error Message (d) None of these
Q15. Which of the following query is incorrect? Assume table EMPLOYEE with attributes (1)
EMPCODE, NAME, SALARY and CITY.
(a) SELECT COUNT(*) FROM EMPLOYEE;
(b) SELECT COUNT(NAME) FROM EMPLOYEE;
(c) SELECT AVG(SALARY) FROM EMPLOYEE;
(d) SELECT MAX(SALARY) AND MEAN(SALARY) FROM EMPLOYEE;
Q16. Which one of the following syntax is correct to establish a connection between Python and (1)
MySQL database using the function connect( ) of mysql.connector package? Assume that import

Page 1 of 12 | KVS –Lucknow Region | Session 2023-24


mysql.connector as mycon is imported in the program
.(a) mycon.connect(host = “hostlocal”, user = “root”, password = “MyPass”)
(b) mycon.connect(host = “localhost”, user = “root”, passwd = “MyPass”, database = “test”)

(c) mycon.connect(“host”=“localhost”, “user”= “root”, “passwd”=”MyPass”, “database”= “test”)

(d) mycon.connect(“localhost” = host, “root”=user, “MyPass”=passwd)

Q-17 and Q-18 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
Q17. Assertion(A): Dictionary is an unordered collection of data values that stores the key: value pair.
Reason(R): Immutable means they cannot be changed after creation.
Q18. Assertion(A): Access mode ‘a’ opens a file for appending content at the end of the file.
Reason(R): The file pointer is at the end of the file if the file exists and opens in write mode.

Que Question Marks


s No
SECTION A
1 State True or False: 1
“In a Python loops can also have else clause”
2 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
3 Which among the following list of operators has the highest precedence? 1
+,-,**,%,/,<<,>>,and, or, +=
a. += b. **
c. and d. %
4 What is the output of the following code? 1
Text = 'Happy hour12-3'
L= ""
for i in range(len(Text)):
if Text[i].isupper():
L=L+Text[i].lower()
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 #

Page 1 of 12 | KVS –Lucknow Region | Session 2023-24


5 In MYSQL database, if a table, Student has degree 2 and cardinality 3, and another 1
table, Address has degree 5 and cardinality 6, what will be the degree and cardinality
of the Cartesian product of student and address?
a. 6,18 b. 7,18
c. 10,9 d. 12,15

Page 1 of 12 | KVS –Lucknow Region | Session 2023-24


6 Praveen 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
7 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
8 Select the correct output of the code:a 1
= "foobar"
a = a.partition("o") (a)
["fo","","bar"]
(b) ["f","oo","bar"]
(c) ["f","o","bar"]
(d) ("f","o","obar")
9 What will be the output of following code if a = “abcde” 1
a [1:1 ] == a [1:2]
type (a[1:1]) == type (a[1:2])

10 What possible outputs are expected to be displayed on the screen at the time of 1
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#

11 Radio-Waves, microwaves and infrared waves are types of 1


a. Wireless transmission b. Guided medium
c. Wired transmission d. unguided transmission
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 State whether the following statement is True or False: 1
An exception may be raised even if the program is syntactically correct.
14 Which of the following keywords will you use in the following query to display the 1
unique values of the column dept_name?
SELECT --------------------- dept_name FROM Company;
(a)All (b) key (c) Distinct (d) Name
6

Page 1 of 12 | KVS –Lucknow Region | Session 2023-24


15 Fill in the blank: 1
In case of switching, message is send in stored and forward
manner from sender to receiver.
16 Which of the following functions returns current position of the file pointer. 1
a. flush() b. tell()
c. seek() d. offset()
Q17 and 18 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
17 Assertion (A): List and Tuples are similar sequence types of Python, yet they are two 1
different data types.
Reason(R): List sequences are mutable and Tuple sequences are immutable.
18 Assertion (A): Python’s built-in functions, which are part of the standard Python 1
Librarycan directly be used without specifying their module name.
Reason(R): Python’s standard library’s built-in functions are made available by default in
the namespace of program.

SECTION - A
1 State True or False 1
“If a loop terminates using break statement, loop else will not execute”
2 BETWEEN clause in MySQL cannot be used for 1
a) Integer Fields b) Varchar fields
c) Date Fields d) None of these
3 What will be the output of the following code snippet? 1
a=10
b=20
c=-5
a,b,a = a+c,b-c,b+c
print(a,b,c)
a) 5 25 -5 b) 5 25 25
c) 15 25 -5 d) 5 25 15
4 What is the result of the following code in python? 1
S="ComputerExam"
print(S[2]+S[-4]+S[1:-7])
a) mEomput b) mEompu
c) MCompu d) mEerExam
5 command is used to add a new column in an existing table in MySQL? 1
6 The IP (Internet Protocol) of TCP/IP transmits packets over Internet using _ 1
switching.
a) Circuit b) Message
c) Packet d) All of the above
7 Consider a list L = [5, 10, 15, 20], which of the following will result in an error. 1
a) L[0] += 3 b) L += 3 c) L *= 3 d) L[1] = 45
8 Which of the following is not true about dictionary ? 1
a) More than one key is not allowed
b) Keys must be immutable
Page 1 of 8
c) Values must be immutable
d) When duplicate keys encountered, the last assignment wins
9 Which of the following statements 1 to 4 will give the same output? 1
tup = (1,2,3,4,5)
print(tup[:-1]) #Statement 1
print(tup[0:5]) #Statement 2
print(tup[0:4]) #Statement 3
print(tup[-4:]) #Statement 4
a) Statements 1 and 2 b) Statements 2 and 4
c) Statements 2 and 5 d) Statements 1 and 3
10 What possible outputs(s) will be obtained when the following code is 1
executed?
import random
VALUES = [10, 20, 30, 40, 50, 60, 70, 80]
BEGIN = random.randint(1,3)
LAST = random.randint(BEGIN, 4)
for x in range(BEGIN, LAST+1):
print(VALUES[x], end = "-")
a) 30-40-50- b) 10-20-30-40-
c) 30-40-50-60- d) 30-40-50-60-70-
11 Which of the following command is used to move the file pointer 2 bytes ahead from the 1
current position in the file stream named fp?
a) fp.seek(2, 1) b) fp.seek(-2, 0)
c) fp.seek(-2, 2) d) fp.seek(2, -2)
12 Predict the output of the following code: 1
def ChangeLists(M , N):
M[0] = 100
N = [2, 3]
L1 = [-1, -2]
L2 = [10, 20]
ChangeLists(L1, L2)
print(L1[0],"#", L2[0])
a) -1 # 10 b) 100 # 10
c) 100 # 2 c) -1 # 2
13 Which of the following is not a function of csv module? 1
a) readline() b) writerow()
c) reader() d) writer()
14 State True or False 1
“A table in RDBMS can have more than one Primary Keys”
15 COUNT(*) function in MySQL counts the total number of in a table. 1
a) Rows b) Columns
c) Null values of column d) Null values of a row
16 Which of the following is not a method for fetching records from MySQL table using Python 1
interface?
a) fetchone() b) fetchrows()
c) fetchall() d) fetchmany()

Page 2 of 8
Q17 and 18 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
17 Assertion (A):- Text file stores information in ASCII or UNICODE characters. 1
Reasoning (R):- In text file there is no delimiter(EOL) for a line.
18 Assertion (A):- HAVING clause is used with aggregate functions in SQL. 1
Reasoning (R):- WHERE clause places condition on individual rows.

SECTION
A
1. State True or False 1
“Python has a set of keywords that can also be used to declare variables”
2. Which of the following is not a valid python operator? 1
a) % b) in c) # d) **
3. What will be the output of the following python dictionary operation? 1
data = {'A':2000, 'B':2500, 'C':3000, 'A':4000}
print(data)
a) {'A':2000, 'B':2500, 'C':3000, 'A':4000}
b) {'A':2000, 'B':2500, 'C':3000}
c) {'A':4000, 'B':2500, 'C':3000}
d) It will generate an error.

4. 1
print(True or not True and False)
Choose one option from the following that will be the correct output after
executing the above python expression.
a) False b) True c) or d) not

5. Select the correct output of the following python code: 1


str="My program is program for you"
t = str.partition("program")
print(t)
a) ('My ', 'program', ' is ', 'program', ' for you')
b) ('My ', 'program', ' is program for you')
c) ('My ', ' is program for you')

1|P age
d) ('My ', ' is ', ' for you')
6. Which of the file opening mode will open the file for reading and writing in 1
binary mode.
a) rb b) rb+ c) wb d) a+

7. Which of the following statements is True? 1


a) There can be only one Foreign Key in a table.
b) There can be only one Unique key is a table
c) There can be only one Primary Key in a Table
d) A table must have a Primary Key.
8. Which of the following is not part of a DDL query? 1
a) DROP
b) MODIFY
c) DISTINCT
d) ADD

9. Which of the following operations on a string will generate an error? 1


a) "PYTHON"*2
b) "PYTHON" + "10"
c) "PYTHON" + 10
d) "PYTHON" + "PYTHON"

10 Keyword is used to obtain unique values in a SELECT 1


. query
a) UNIQUE
b) DISTINCT
c) SET
d) HAVING
11 Which of the following python statement will bring the read pointer to 10 th 1
. character from the end of a file containing 100 characters, opened for
reading in binary mode.
a) File.seek(10,0)
b) File.seek(-10,2)
c) File.seek(-10,1)
d) File.seek(10,2)

12 Which statement in MySql will display all the tables in a database? 1


. a) SELECT * FROM TABLES;
b) USE TABLES;
c) DESCRIBE TABLES;
d) SHOW TABLES;
13 Which of the following is used to receive emails over Internet? 1
. a) SMTP b) POP c) PPP d) VoIP
2|P age
4 What will be the output of the following python expression? 1
print(2**3**2)
a) 64 b) 256 c) 512 d) 32

5 Which of the following is a valid sql statement? 1


a) ALTER TABLE student SET rollno INT(5);
b) UPDATE TABLE student MODIFY age = age + 10;
c) DROP FROM TABLE student;
d) DELETE FROM student;
6 Which of the following is not valid cursor function while performing database 1
operations using python. Here Mycur is the cursor object?
a) Mycur.fetch()
b) Mycur.fetchone()
c) Mycur.fetchmany(n)
d) Mycur.fetchall()
17 and 18 are ASSERTION AND REASONING based questions. Mark the correct
hoice 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
7 Assertion (A): A variable declared as global inside a function is visible 1
withchanges made to it outside the function.
Reasoning (A): All variables declared outside are not visible inside a function
till they are redeclared with global keyword.
8 Assertion (A): A binary file in python is used to store collection objects like 1
lists and dictionaries that can be later retrieved in their original form using
pickle module.
Reasoning (A): A binary files are just like normal text files and can be read
using a text editor like notepad.

1
SECTION A
1. Fill in the Blank 1
The explicit conversion of an operand to a specific type is called
(a)Type casting (b) coercion (c) translation (d) None of these
2. Which of the following is not a core data type in Python?(a)Lists 1
(b) Dictionaries (c)Tuple (d) Class
3. What will the following code do? 1
dict={"Exam":"AISSCE", "Year":2022}
dict.update({"Year”:2023} )

a. It will create new dictionary dict={” Year”:2023}and old dictionary


will be deleted
b. It will throw an error and dictionary cannot updated
c. It will make the content of dictionary as dict={"Exam":"AISSCE",
"Year":2023}
d. It will throw an error and dictionary and do nothing
4. What will be the value of the expression :14+13%15 1
5 Select the correct output of the code: 1
a= "Year 2022 at All the best" a = a.split('2')
a = a[0] + ". " + a[1] + ". " + a[3] print (b)
(a) Year . 0. at All the best (b) Year 0. at All the best
(c) Year . 022. at All the best (d) Year . 0. at all the best

6. Which of the following mode will refer to binary data?(a)r 1


(b) w (c) + (d) b
7. Fill in the blank: 1
command is used to remove a column from a table in SQL.
(a) update (b)remove (c) alter (d)drop
8. Which of the following commands will delete the rows of table? 1
(a) DELETE command (b) DROP Command
(c) REMOVE Command (d) ALTER Command
9. Which of the following statement(s) would give an error after executing the following code? 1
S="Welcome to class XII" # Statement 1print(S) #
Statement 2 S="Thank you" # Statement 3
S[0]= '@' # Statement 4
S=S+"Thank you" # Statement 5

(a) Statement 3 (b) Statement 4


(b) Statement 5 (d) Statement 4 and 5
10. Logical Operators used in SQL are? 1
(a) AND,OR,NOT (b) &&,||,!
(c) $,|,! (d) None of these

2
11 The correct syntax of seek() is:
(a) file_object.seek(offset [, reference_point]) (b) seek(offset [,
reference_point])
(c) seek(offset, file_object) (d)
seek.file_object(offset)
12. Fill in the blank: 1
All tuples in the relation are assigned NULL as the value for the new Attribute,with the
Command
(a) MODIFY (b) TAILOR (c)ELIMINATE (d) ALTER
13. What is the size of IPv4 address? 1
(a)32 bits (b) 64 bits (c) 64 bytes (d) 32 bytes
14. What will be the output of the following expression?24//6%3 , 1
24//4//2 , 48//3//4
a)(1,3,4) b)(0,3,4) c)(1,12,Error) d)(1,3,#error)
15. Which of the following ignores the NULL values inSQL? 1
a) Count(*) b) count() c)total(*) d)None of these
16. Which of the following is not a legal method for fetching records from a database from within aPython 1
program?
(a) fetchone() b)fetchtwo() (c) fetchall() (d) fetchmany()
Q17 and 18 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
17. Assertion (A):- If the arguments in a function call statement match the number and order of arguments as 1
defined in the function definition, such arguments are called positional arguments.
Reasoning (R):- During a function call, the argument list first contains default argument(s)followed by
positional argument(s).
18. Assertion (A): CSV (Comma Separated Values) is a file format for data storage which looks like atext file. 1
Reason (R): The information is organized with one record on each line and each field is separatedby comma.

SECTION – A
1. State True or False
1
“Python language is Cross platform language.”
2. Which of the following is an invalid identifier in Python? 1
(a) Max_marks (b) Max–marks (c) Maxmarks (d) _Max_Marks
3. Predict the output. 1
marks = {"Ashok":98.6, "Ramesh":95.5}
print(list(marks.keys()))

(a) ‘Ashok’, ‘Ramesh’


(b) 98.6, 95.5
(c) [‘Ashok’,’Ramesh’]
(d) (‘Ashok’,’Ramesh’)
4. Consider the given expression: 1
not True and False or not True
Which of the following will be correct output if the given expression is evaluated?
(a) True
(b) False
(c) NONE
(d) NULL
5. Write the output:- 1
myTuple = ("John", "Peter", "Vicky") x
= "#".join(myTuple)
print(x)
(a) #John#Peter#Vicky
(b) John#Peter#Vicky
(c) John#Peter#Vicky#
(d) #John#Peter#Vicky#
6. Which of the following mode in file opening statement results or generates an error ifthe file 1
does not exist?
(a) r+ (b) a+ (c) w+ (d) None of the above
7. Fill in the blank: 1
command is used to ADD a column in a table in SQL.
(a) update (b)remove (c) alter (d)drop
8. Which of the following is a DML command? 1
(a) CREATE (b) ALTER (c) INSERT (d) DROP
9. Which of the following statement(s) would give an error after executing the following code? 1
S="Welcome to my python program" # Statement 1
print(S) # Statement 2
S="Python is Object Oriented programming" # Statement 3
S= S * “5” # Statement 4
S=S+"Thank you" # Statement 5
(a) Statement 3
(b) Statement 4
(c) Statement 5
(d) Statement 4 and 5

10. Fill in the blank: 1


is a non-key attribute, whose values are derived from the primary key ofsome
other table.
(a) Foreign Key
(b) Primary Key
(c) Candidate Key
(d) Alternate Key
11. Which SQL keyword is used to retrieve only unique values? 1
(a) DISTINCTIVE (b) UNIQUE (c) DISTINCT (d) DIFFEREN
12. The correct syntax of seek() is: 1
(a) file_object.seek(offset [, reference_point])
(b) seek(offset [, reference_point])
(c) seek(offset, file_object)
(d) seek.file_object(offset)
13. Fill in the blank: 1
is a communication methodology designed to deliver electronic mail (E-mail)over the
internet.
.
(a) VoIP (b) HTTP (c) PPP (d) SMTP
14. What will the following expression be evaluated to in Python?print(2**3 + (5 + 1
6)**(1 + 1))
(a) 129 (b)8 (c) 121 (d) None
15. Which function is used to display the total number of records from a table in adatabase? 1
(a) sum(*)
(b) total(*)
(c) count(*)
(d) return(*)

16. Which of the following function is used to established connection between Python andMySQL 1
database –
(a) connection() (b) connect() (c) Connect() (d) None
Q17 and 18 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
Assertion (A): A binary file stores the data in the same way as as stored in the memory. 1
17.
Reason (R): Binary file in python does not have line delimiter.
Assertion (A):- If the arguments in a function call statement match the number and order of
arguments as defined in the function definition, such arguments are called positional
18. arguments. 1
Reasoning (R):- During a function call, the argument list first contains default
argument(s) followed by positional argument(s).

SECTIONA
1 Findtheinvalididentifierfromthefollowing 1
a) Marks@12 b)string_12 c)_bonus d)First_Name
2 IdentifythevaliddeclarationofRec: Rec=(1,‟Ashoka",50000) 1
a) List b) Tuple c)String d) Dictionary

3 SupposeatupleTupisdeclaredasTup=(12,15,63,80) whichof the following is 1


incorrect?
a) print(Tup[1]) b)Tup[2]= 90
c)print(min(Tup)) d)print(len(Tup))
4 Thecorrectoutputofthegivenexpressionis: 1
TrueandnotFalseorFalse
(a)False (b)True (c)None (d) Null
5 t1=(2,3,4,5,6) 1
print(t1.index(4))
output is
(a)4 (b)5 (c)6 (d)2
6 Whichofthefollowingmodesisusedtoopenabinaryfileforwriting 1
(a)b (b)rb+ (c)wb (d)rb
7 Fillintheblank: 1
The commandisusedinaWHERE clausetosearchfora specified
pattern in a column.
(a)match (b)similar (c)like (d)pattern
8 Whichofthefollowingcommandsisusedtomodifyatablein SQL? 1
(a)MODIFYTABLE (b)DROPTABLE
(c)CHANGETABLE (d)ALTER TABLE
9 Whichofthefollowingstatement(s)wouldgiveanerrorafter executing 1
the following code?
x=int("EntertheValueofx:"))#Statement1 for y in
range[0,21]: #Statement2 if
x==y: #Statement 3
print (x+y) #Statement4
else: #Statement5
print(x-y) #Statement6
(a)Statement4 (b)Statement5
(c)Statement4&6 (d)Statement1&2
10 Fillintheblank: 1
Foreachattributeofarelation,thereisasetofpermittedvalues, called the
of that attribute.
(a)cardinality (b)degree (c)domain (d)tuple
11 Whatisthesignificanceofthetell()method? 1
(a) tellsthepathofthefile.
(b) tellsthecurrentpositionofthefilepointerwithinthefile.
(c) tellstheendpositionwithinthefile.
(d) checkstheexistenceofafileatthedesiredlocation.
12 Fillintheblank: 1
The SELECT statement when combined with clause,
returns records in sorted order.
(a) SORT (b)ARRANGE (c)ORDERBY (d)SEQUENCE
13 Fillintheblank: 1
The isamailprotocolusedtoretrievemailfromaremote server to a
local email client.
(a)VoIP(b) FTP(c)PPP(d)HTTP
14 EvaluatethefollowingPythonexpression print(12*(3%4)//2+6) 1
(a)12 (b)24 (c)10 (d)14

15 InSQL,theaggregatefunctionusedtocalculate anddisplaythe average of numeric 1


values in an attribute of a relation is:
(a)sum() (b)total() (c)count() (d)avg()
16 Thenameofthemoduleusedtoestablishaconnectionbetween Python and SQL 1
database is-
(a) mysql-connect (b)mysql-connector
(c)mysql-interface (d)mysql-conn
Q17and18areASSERTIONANDREASONINGbasedquestions.
Markthecorrectchoiceas
(a) BothAandRaretrueandRisthecorrectexplanationforA
(b) BothAandRaretrueandRisnotthecorrectexplanationforA
(c) AisTruebutRisFalse
(d) AisfalsebutRisTrue
17 Assertion(A):-Thedefaultargumentscanbeskippedinthefunction call. 1
Reasoning(R):-Thefunctionargumentwilltakethe defaultvalues even if the
values are supplied in the function call

18 Assertion(A):-Ifatextfilealreadycontainingsometextisopenedin write mode the 1


previous contents are overwritten.
Reasoning(R):-Whenafileisopenedinwritemodethefile pointeris present at the
beginning position of the file

QNo SECTION-A Marks


1 Which command comes under TCL(Transaction Control Language)? 1
(a)alter (b)update (c) grant (d) create
2 Which of the following is an invalid datatype in Python?
(a) list (b) Dictionary (c)Tuple (d)Class 1
3 Given the following dictionaries dict_fruit={"Kiwi":"Brown",
"Cherry":"Red"} dict_vegetable={"Tomato":"Red",
"Brinjal":"Purple"}
Which statement will merge the contents of both dictionaries? 1

(a) dict_fruit.update(dict_vegetable) (b) dict_fruit + dict_vegetable


(c) dict_fruit.add(dict_vegetable) (d) dict_fruit.merge(dict_vegetable)
4 Consider the given expression:
not False and False or True
Which of the following will be correct output if the given expression is evaluated? 1
True b.False c. NONE d. NULL

5 Select the correct output of the code:

(a) 0 1 2 ….. 15 (b)Infinite loop


(c) 0 3 6 9 12 15 (d) 0 3 6 9 12
6 Which of the following is not a valid mode to open a file?
1
(a) ab (b) r+ (c) w+ (d) rw
7 Fill in the blank:
command is used to delete the table from the database of SQL. 1
(a) update (b)remove (c) alter (d) drop
8 Which of the following commands will use to change the structure of table in
MYSQL database?
(a)DELETE TABLE (b)DROP TABLE 1
(c)REMOVE TABLE (d)ALTER TABLE
9 What possible output(s) are expected to be displayed on screen at the time of
execution of the program from the following code?
import random
points=[20,40,10,30,15]
points=[30,50,20,40,45]
begin=random.randint(1,3) 1
last=random.randint(2,4) for
c in range(begin,last+1):
print(points[c],"#")
(a) 20#50#30# (b) 20#40#45
(c) 50#20#40# (d) both (b) and (c)
10 Fill in the blank:
is an attribute whose value is derived from the primary keyof
some other table.
1
(a) Primary Key (b) Foreign Key
(c) Candidate Key (d) Alternate Key

11 The tell() function returns:


(a) Number of bytes remaining to be read from the file
(b) Number of bytes already read from the file
(c) Number of the byte written to the file 1
(d) Total number of bytes in the file

12 Fill in the blank:


The SELECT statement when combined with function,
returns number of rows present in the table. 1
(a) DISTINCT (b) UNIQUE (c) COUNT (d) AVG

13 Which switching technique follows the store and forward mechanism?


(a) Circuit switching (b) message switching
1
(c) packet switching (d) All of these

14 What will the following expression be evaluated to in Python?


print(16-(3+2)*5+2**3*4) 1
(a) 54 (b) 46 (c) 23 (d) 32
15 Which function is used to display the unique values of a column of a table?
1
(a) sum() (b) unique() (c)distinct() (d)return()
16 To establish a connection between Python and SQL database, connect() is used.
Which of the following value can be given to the keyword argument – host, while
calling connect ()?
(a) localhost 1
(b) 127.0.0.1
(c) any one of (a) or (b)
(d) localmachine
Q17 and 18 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
1
(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
17 Assertion (A):- key word arguments are related to the function calls. Reasoning
(R):- when you use keyword arguments in a function call, the caller identifies the 1
arguments by parameter name.
18 Assertion (A): CSV stands for Comma Separated Values
Reason (R): CSV files are a common file format for transferring and storing data. 1

SECTION A
1. Identify the incorrect variable name: (1)
a) int b) float c) while d) true
2. What will be the data type of of the expression 12/5==0? (1)
a) True b) False c) bool d) float
3. What will be output of the following code: (1)
d1={1:2,3:4,5:6}
d2=d1.get(3,5)
print(d2)
a) 3 b) 4 c) 5 d) Error

4. Consider the given expression: (1)


8 and 13 > 10
Which of the following is the correct value of the expression?
a) True b) False c) None d) NULL
5. Fill in the blank: (1)
command is used to remove a column from a table in SQL.
a) update b) remove c) alter d)drop
6. Which of the following mode in file opening statement generates an error ifthe file (1)
does not exist?
a) a+ b) r+ c) w+ d) None of these
7. Which of the following commands will delete a table from a MYSQL database? (1)
a) DELETE b) DROP c) REMOVE d) ALTER

8. Fill in the blank: (1)


An alternate key is a , which is not the primary key of the table.
a) Primary Key b) Foreign Key c) Candidate Key d) Alternate Key

1
9. Select the correct output of the code: (1)
a = "assistance"
a = a.partition('a')
b = a[0] + "-" + a[1] + "-" + a[2]
print (b)
a) -a-ssistance b) -a-ssist-nce
c) a-ssist-nce d) -a-ssist-ance

0. Which of the following statement(s) would give an error during execution? (1)
S=("CBSE") # Statement 1
S+="Delhi" # Statement 2
S[0]= '@' # Statement 3
S=S+"Thank you" # Statement 4
a) Statement 1 b) Statement 2 c) Statement 3 d) Statement 4

1. tell() is a method of: (1)


a) pickle module b) csv module c) file object d) seek()

2. Select the correct statement, with reference to RDBMS: (1)


a) NULL can be a value in a Primary Key column
b) '' (Empty string) can be a value in a Primary Key column
c) A table with a Primary Key column cannot have an alternate key.
d) A table with a Primary Key column must have an alternate key.

3. Which protocol is used for transferring files over a TCP/IP network? (1)
a) FTP b) SMTP c) PPP d) HTTP
4. What will the following expression be evaluated to in Python? (1)
27 % 7 // (3 / 2)
a) 2 b) 2.0 c) 4.0 d) 4
5. Which function cannot be used with string type data? (1)
a) min() b) max() c) count() d) sum()
6. In context of Python - Database connectivity, the function fetchmany()is amethod of (1)
which object?
a) connection b) database c) cursor d) query
Q17 and 18 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
c) A is True but R is False
d) A is false but R is True

7. Assertion (A):- print(f1())is a valid statement even if the function f1() (1)
has no return statement.
Reasoning (R):- A function always returns a value even if it has no return
statement.

8. Assertion (A): If L is a list, then L+=range(5)is an invalid statement.Reason (R): Only (1)
a list can be concatenated to a list.

Page 1 of 9
SECTION A
1 Identify the invalid Python statement from the following. 1
(a) _b=1 (b) b1= 1 (c) b_=1 (d) 1 = _b

2 Identify the valid arithmetic operator in Python from the following. 1


(a) // (b) < (c) or (d) <>

3 If Statement in Python is 1
(a) looping statement (b) selection statement (c) iterative (d) sequential

4 Predict the correct output of the following Python statement – 1


print(4 + 3**3/2)

(a) 8 (b) 9 (c) 8.0 (d) 17.5

5 Choose the most correct statement among the following – 1

(a) a dictionary is a sequential set of elements


(b) a dictionary is a set of key-value pairs
(c) a dictionary is a sequential collection of elements key-value pairs
(d) a dictionary is a non-sequential collection of elements

6 Consider the string state = “Jharkhand”. Identify the appropriate statement that will display the last 1
five characters of the string state?

(a) state [-5:] (b) state [4:] (c) state [:4] (d) state [:-4]

7 What will be the output of the following lines of Python code? 1

if not False:
print(10)
else:
print(20)

Page 2 of 9
(a) 10 (b) 20 (c) True (d) False

8 Consider the Python statement: f.seek(10, 1) 1


Choose the correct statement from the following:

(a) file pointer will move 10 byte in forward direction from beginning of the file
(b) file pointer will move 10 byte in forward direction from end of the file
(c) file pointer will move 10 byte in forward direction from current location
(d) file pointer will move 10 byte in backward direction from current location

9 Which of the following function returns a list datatype? 1

a) d=f.read() b) d=f.read(10) c) d=f.readline() d) d=f.readlines()

10 Identify the device on the network which is responsible for forwarding data from one device to 1
another

(a) NIC (b) Router (c) RJ45 (d) Repeater

11 A table has initially 5 columns and 8 rows. Consider the following sequence of operations 1
performed on the table –
i. 8 rows are added
ii. 2 columns are added
iii. 3 rows are deleted
iv. 1 column is added
What will be the cardinality and degree of the table at the end of above operations?

(a) 13,8 (b) 8, 13 (c) 14,5 (d) 5,8

12 Which of the following constraint is used to prevent a duplicate value in a record? 1

(a) Empty (b) check (c) primary key (d) unique

13 The structure of the table/relation can be displayed using command. 1

(a) view (b) describe (c) show (d) select

14 Which of the following clause is used to remove the duplicating rows from a select statement? 1

(a) or (b) distinct (c) any (d)unique

15 How do you change the file position to an offset value from the start? 1
(a) fp.seek(offset, 0) (b) fp.seek(offset, 1) (c) fp.seek(offset, 2) (d) None of them

16 Which of the following method is used to create a connection between the MySQL database and 1
Python?
(a) connector ( ) (b) connect ( ) (c) con ( ) (d) cont ( )

Q17 and 18 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
Page 3 of 9
7 Assertion (A): The function definition calculate(a, b, c=1,d) will give error. 1
Reason (R): All the non-default arguments must precede the default arguments.

8 Assertion (A): CSV files are used to store the data generated by various social media platforms. 1
Reason (R): CSV file can be opened with MS Excel.

Section – A
Q01. State True or False (1)
“Tuple is datatype in Python which contain data in key-value pair.”

Q02. Which of the following is not a keyword? (1)


(A) eval (B) assert
(C) nonlocal (D) pass

Q03. Given the following dictionaries (1)


dict_student = {"rno" : "53", "name" : ‘Rajveer Singh’}
dict_marks = {"Accts" : 87, "English" : 65}
Which statement will merge the contents of both dictionaries?
(A) dict_student + dict_marks (B) dict_student.add(dict_marks)
(C) dict_student.merge(dict_marks) (D) dict_student.update(dict_marks)
Q04. Consider the given expression: (1)
not ((True and False) or True)

Page 1 of 14 | KVS – Regional Office AGRA | Session 2022-23


Which of the following will be correct output if the given expression is evaluated?
(A) True (B) False
(C) NONE (D) NULL
Q05. Select the correct output of the code: (1)
>>> s='[email protected]'
>>> s=s.split('kv')
>>> op = s[0] + "@kv" + s[2]
>>> print(op)
(A) mail2@kvsangathan (B) mail2@sangathan.

(C) mail2@kvsangathan. (D) mail2kvsangathan.


Q06. Which functions is used to close a file in python? (1)
(A) close (B) cloose()
(C) Close() (D) close()
Q07. Fill in the blank: (1)
command is used to change table structure in SQL.
(A) update (B) change
(C) alter (D) modify
Q08. Which of the following commands will remove the entire database from MYSQL? (1)
(A) DELETE DATABASE (B) DROP DATABASE
(C) REMOVE DATABASE (D) ALTER DATABASE
Q09. Which of the following statement(s) would give an error after executing the following code? (1)
D={'rno':32,'name':'Ms Archana','subject':['hindi','english','cs'],'marks':(85,75,89)} #S1
print(D) #S2
D['subject'][2]='IP' #S3
D['marks'][2]=80 #S4
print(D) #S5
(A) S1 (B) S3
(C) S4 (D) S3 and S4
Q10. Fill in the blank: (1)
is a non-key attribute, whose values are derived from the primary key of some other table.
(A) Primary Key (B) Candidate Key
(C) Foreign Key (D) Alternate Key

Page 2 of 14 | KVS – Regional Office AGRA | Session 2022-23


Q11. The correct syntax of seek() is: (1)
(A) seek(offset [, reference_point]) (B) seek(offset, file_object)
(C) seek.file_object(offset) (D) file_object.seek(offset [, reference_point])
Q12. Fill in the blank: (1)
The SELECT statement when combined with clause, returns records without
repetition.
(A) DISTINCT (B) DESCRIBE
(C) UNIQUE (D) NULL
Q13. Fill in the blank: (1)
is a communication methodology designed to deliver both voice and multimedia
communications over Internet protocol.
(A) SMTP (B) VoIP
(C) PPP (D) HTTP
Q14. What will the following expression be evaluated to in Python? (1)
print ( round (100.0 / 4 + (3 + 2.55) , 1 ) )
(A) 30.0 (B) 30.55
(C) 30.6 (D) 31
Q15. Which function is used to display the total number of records from a table in a database? (1)
(A) total() (B) total(*)
(C) return(*) (D) count(*)
Q16. In order to open a connection with MySQL database from within Python using mysql.connector (1)
package, function is used.
(A) open (B) connect
(C) database() (D) connectdb()
Q17 and 18 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
Q17. str1= “Class” + ”Work” (1)
ASSERTION: Value of str1 will be “ClassWork”.
REASONING: Operator ‘+’ adds the operands, if both are numbers & concatenates the string if
both operands are strings.

Page 3 of 14 | KVS – Regional Office AGRA | Session 2022-23


Q18. Assertion: CSV (Comma Separated Values) is a file format for data storage which looks like a (1)
text file.
Reason (R): The information is organized with one record on each line and each field is separated
by semi-colon.

Q. Optio Questions Description Marks


No. n No. Allotted
1. Identify the invalid keyword in Python from the following: 1
(a) True (b) None (c) Import (d) return
2. Write the output of the following python expression: 1

3. Write the importance of passing file mode while declaring a file object in 1
data file handling.
4. Find the operator which cannot be used with a string in Python from the 1
following:
(a) + (b) in (c) * (d) //
5. Write the output of the following python statements: 1

6. Consider the tuple in python named DAYS=(”SUN”,”MON”,”TUES”). 1

Page No. 1
Identify the invalid statement(s) from the given below statements:
1. S=DAYS[1]
2. print(DAYS[2])
3. DAYS[0]=”WED”
4. LIST=list(DAYS)
7. Declare a dictionary in python named QUAD having Keys(1,2,3,4) and 1
Values(“India”,”USA”,”Japan”,”Australia”)
8. _ is a collection of similar modules or packages that are used to 1
fulfills some functional requirement for a specific type of application.
9. Website incharge KABIR of a school is handling 1
downloading/uploading various files on school website. Write the name
of the protocol which is being used in the above activity.
10. What is its use of Data encryption in a network communication? 1
11. In SQL, write the name of the aggregate function which is used to 1
calculate & display the average of numeric values in an attribute of a
relation.
12. Write an SQL query to display all the attributes of a relation named 1
“TEST” along with their description.
13. What is the use of LIKE keyword in SQL? 1
14. Which of the following is NOT a DML command? 1
1. SELECT 2. DELETE 3. UPDATE 4. DROP
15. Give the full form of the following: 1
(a) URL (b) TDMA
16. Identify the output of the following python statements if there is no 1
error. Otherwise, identify the error(s):

17. List one common property of a String and a Tuple. 1


18. What is the purpose of following SQL command: 1
SHOW DATABASES;
19. Differentiate between Bps & bps. 1
20. Identify the error in the following SQL query which is expected to delete 1
all rows of a table TEMP without deleting its structure and write the
correct one:
DELETE TABLE TEMP;
21. Identify the Guided and Un-Guided Transmission Media out of the 1
following:
Satellite, Twisted Pair Cable, Optical Fiber, Infra-Red waves

Q.No Part-A Marks


Section-I
Attemptany15questionsfromquestionno1to21.
1 CanListbeused askeysofadictionary? 1

Page No. 2
2 WhichoneisvalidrelationaloperatorinPython 1
i. /
ii. =
iii. ==
iv. and
3 Whichofthefollowingcanbeusedasvalidvariableidentifiersin Python? 1
i) 4thSum
ii) Total
iii) Number#
iv) _Data
4 Identifythemutabledatatypes? 1
(i) List
(ii) Tuple
(iii) Dictionary
(iv) String
5 Whatisthelengthofthetupleshownbelow? 1
t=(((('a',1),'b','c'),'d',2),'e',3)
6 Anon-keyattribute,whosevaluesarederivedfromprimarykeyofsome other table. 1
i. AlternateKey
ii. ForeignKey
iii. Primary Key
iv. CandidateKey

7 WhatisTelnet? 1
8 StatewhetherthefollowingstatementsisTrueorFalse. 1
Whentwoentitiesare communicatinganddonotwantathirdpartytolisten, this
situation is defined as secure communication.
9 Expandtheterm 1
i. XML
ii. SMS
10 Nametwowebscriptinglanguages. 1
11 Whatistheoutputofthebelow program? 1

defsay(message,times=1):
print(message * times)
say('Hello')
say('World',5)
12 Namethepythonlibraryneedtobeimportedtoinvokefollowingfunction 1
i. sqrt()
ii. randint()
13 WriteaPythonDictionarynamedclassstudentwithkeys12101,12102,12103 1
andcorrespondingvaluesas‘Rahul’,’Ravi’,’Mahesh’respectively
14 IdentifytheDDL Command. 1
(i) Insertintocommand
(ii) Createtable command
(iii) DroptableCommand
(iv) Deletecommand

Page No. 3
15 t1=(2,3,4,5,6) 1
print(t1.index(4)) output
is
i. 4
ii. 5
iii. 6
iv. 2
16 WhichclauseisusedwithaSELECTcommandinSQLtodisplaytherecordsin 1
ascendingorderofan attribute?
17 Whichoftheseisnotanexampleofunguidedmedia? 1
(i)OpticalFibreCable(ii)Radiowave(iii)Bluetooth(iv)Satellite
18 Arelationhas45tuples&5attributes,whatwillbetheDegree&Cardinality of that 1
relation?
i. Degree5,Cardinality45
ii. Degree45,Cardinality5
iii. Degree50,Cardinality45
iv. Degree50,Cardinality2250
19 InSQL,whichaggregatefunctionisusedtocountallrecordsof atable? 1

Questio Part A Marks


n No.
Section-I
Select the most appropriate option out of the options given for eachquestion.
Attempt any 15 questions from question no 1 to 21.
1 Which of the following is valid arithmetic operator in Python: 1
(i) // (ii)? (iii) < (iv) and
2 Namethe PythonLibrarymoduleswhichneedto be imported to invokethe 1
following functions:
(i) sin( ) (ii) randint ( )
3 Which statement is used to retrieve the current position within the file? 1
a)fp.seek( ) b) fp.tell( ) c) fp.loc d) fp.pos
4 Which is the correct form of declaration of dictionary? 1
(i) Day={1:’monday’,2:’tuesday’,3:’wednesday’}
(ii) Day=(1;’monday’,2;’tuesday’,3;’wednesday’)
(iii) Day=[1:’monday’,2:’tuesday’,3:’wednesday’]

Page 2 of 10
(iv) Day={1’monday’,2’tuesday’,3’wednesday’]
5 Call the given function using KEYWORD ARGUMENT with values 100 and200 1
def Swap(num1,num2):
num1,num2=num2,num1
print(num1,num2)

6 Function can alter only Mutable data types? (True/False) 1


7 How can you access a global variable inside the 1
function, if function has a variable with same name?
8 Stack is a data structure that follows order 1
a) FIFO b) LIFO c)FILO d) LILO
9 If the following code is executed, what will be the output of the following code? 1
name="Computer Science with Python"
print(name[2:10])
10 Write down the status of Stack after each operation: 1
Stack = [10,20,30,40] where TOP item is 40
i) Pop an item from Stack
ii) Push 60
11 ---------------------- describe the maximum data transfer rate of a network or 1
Internet connection.
12 Expand : a) SMTP b) GSM 1
13 Mahesh wants to transfer data within a city at very high speed. Write the wired 1
transmission medium and type of network.
14 What is a Firewall in Computer Network? 1
A. The physical boundary of Network
B. An operating System of Computer Network
C. A system designed to prevent unauthorized access
D. A web browsing Software
15 A device used to connect dissimilar networks is called ........... 1
a) hub b) switch c) bridge d)gateway
16 Which command is used to see the structure of the table/relation. 1
a) view b) describe c) show d) select
17 A virtual table is called a ............. 1
18 Which clause is used to remove the duplicating rows of the table? 1

Page 3 of 10
i) or ii) distinct iii) any iv)unique
19 Which clause is used in query to place the condition on groups in MySql? 1
i) where ii) having iii) group by iv) none of the above
20 Which command is used for counting the number of rows in a database? 1
i) row ii) count iii) rowcount iv) row_count
21 A Resultset is an object that is returned when a cursor object is used to query a 1
table. True/False

PART – A
SECTION–I
Selectthemostappropriateoptionoutoftheoptionsgivenforeachquestion. Attempt any 15
questions from question no 1 to 21.

1. WhichofthefollowingisnotavalididentifierinPython? 1
a) KV2 b)_main c)Hello_Dear1 d)7Sisters
2. Avariablecreatedordefinedinafunctionbodyisknownas… 1
a) local b)global c)built-in d)instance
3. Supposelist1 =[0.5*xforxin range(0,4)],list1 is 1
a) [0,1,2,3] b)[0,1,2,3,4]
c)[0.0,0.5,1.0,1.5] d)[0.0,0.5,1.0,1.5,2.0]
4. Whichstatementisnotcorrect 1

Page 4 of 10
a) Thestatementx=x+10isavalidstatement
b) List slice isalistitself.
c) Listsareimmutablewhilestringsaremutable.
d) Listsandstringsinpythonssupporttwowayindexing.
5. Whatwillbetheoutputoffollowingcodesnippet: 1
msg=“HelloFriends”
msg [ : : -1]

a) Hello b)HelloFriend c) 'sdneirF olleH' d)Friend


6. Whichofthefollowingfunctionisusedtowritedatainbinarymode? 1
a) write() b)output() c)dump() d)send()
7. SupposeatupleT1is declaredas 1
T1=(10,20,30,40, 50)
whichofthefollowingisincorrect?
a) print(T[1]) b)T[2]=-29 c)print(max(T)) d)print(len(T))

8. Whatwillbeoutputoffollowing: 1
d={1 : “SUM”,2:“DIFF”,3:“PROD”}

for i in d:
print (i)

a) 1 b) SUM c) 1 d) 3
2 DIFF SUM SUM
3 PROD 2 3
DIFF DIFF
3 3
PROD PROD
9. Whatwillbeoutputoffollowingcode: 1
X = 50
def funct(X):

X=2
funct(X)

print(„Xisnow:„,X)

a) Xisnow:50 b)Xisnow:2 Page 5 ofc)Error


10 d)Noneoftheabove
10. Toreadthenextlinefromthefileobjectfob,wecanuse: 1
a) fob.read(2) b)fob.read() c)fob.readline() d)fob.readlines()
11. TCP/IPstandsfor 1
a) TransmissionCommunicationProtocol/InternetProtocol
b) TransmissionControlProtocol/InternetProtocol
c) TransportControlProtocol/InterworkProtocol
d) TransportControlProtocol/InternetProtocol
12. Anattackthat encryptsfilesinacomputerand only getsdecryptedafter 1
payingmoneyto theattacker..
a) Botnet b)Trojan c)Ransomware d)Spam
13. WhichisknownasrangeoperatorinMySQL. 1
a) IN b)BETWEEN c)IS d)DISTINCT
14. Ifcolumn“salary”oftable“EMP”containsthedataset{10000,15000,25000, 1
10000,25000},whatwillbetheoutputoffollowingSQLstatement? SELECT SUM(DISTINCT SALARY)
FROM EMP;
a) 75000 b)25000 c)10000 d)50000
15. Whichofthefollowingfunctionsisusedtofindthelargestvaluefromthegiven 1
datainMySQL?
a) MAX() b)MAXIMUM() c)LARGEST() d)BIG( )
16. NametheclauseusedinquerytoplacetheconditionongroupsinMySQL? 1
17. Write the name oftopology inwhich all the nodes are connected through a 1

single Coaxial cable?


18. WriteSQLstatementtofindtotalnumberofrecordsintableEMP? 1
19. WritefullformofVoIP. 1
20. WritecommandtolisttheavailabledatabasesinMySQL. 1
21. ExpandthetermDHCP.

Q.NO Section-I Marks


Select the most appropriate option out of the options given for each question. Attempt any 15 Allotted
questions from question no 1 to 21.
1 Which of the following is valid relational operator in Python: ? 1
(i)// (ii)? (iii)< (iv)and
2 Given the lists L=[1,3,6,82,5,7,11,92] , write the output of print(L[2:5]) 1
3 Which module is used for working with CSV files in Python? 1
4 Identify the valid declaration of L: 1
L = [1, 23, ‘hi’, 6]
(i)list (ii)dictionary (iii)array (iv)tuple
5 Suppose list L is declared as L = [0.5 * i for i in range (0,4)], list L is 1
a) [0,1,2,3]
1|Pag
e
b) [0,1,2,3,4]
c) [0.0,0.5,1.0,1.5]
d) [0.0,0.5,1.0,1.5,2.0]
6 Write a statement in Python to declare a dictionary whose keys are ‘Jan’, ’Feb’, ’Mar’ and values 1
are 31, 28 and 31 respectively.
7 A list is declared as 1
L=[(2,5,6,9,8)]
What will be the value of print(L[0])?
8 A function definition in python begins with which keyword? 1
9 Name the protocol that is used for the transfer of hypertext content over the web. 1
10 In a Multi-National company Mr. A steals Mr. B’s intellectual work and representing it as A’s own 1
work without citing the source of information, which kind of act this activity be termed as?
11 In SQL, name of the keyword used to display unique values of an attribute. 1
12 In SQL, what is the use of ORDER BY clause ? 1
13 Write the function used in SQL to display current date. 1
14 Which of the following is a DML command? 1
a) CREATE b)ALTER c) INSERT d) DROP
15 Give at least two names for Guided and Unguided Transmission Media in networking. 1
16 What will be the output when the following code is executed 1
>>> str1 = “helloworld”
>>> str1[ : -1]
a. 'dlrowolleh' b.‘hello’ c.‘world’ d.'helloworl'
17 If the following code is executed, what will be the output of the following code? name="Kendriya 1
Vidyalaya Class 12"
print(name[9:15])
18 In SQL, write the command / query to display the structure of table ‘emp’ stored in a database. 1
19 Write the expanded form of Wi-Fi and GSM. 1
20 Which of the following type of column constraints will allow the entry of unique and not null values 1
in the column?
a) Unique
b) Distinct
c) Primary Key
d) NULL
21 Rearrange the following terms in increasing order of data transfer rates. 1
Gbps, Mbps, Tbps, Kbps, bps

P
A
R
T

2|Pag
e
tiSection – I

Select the most appropriate option out of the options given for each
question. Attempt any
S 15 questions from question no. 1 to 21.
e
c
1 Which of the following is not a valid identifier name in Python? Justify reason 1
for it not being a valid name.
a) 5Total b) _Radius c) pie d)While
2 Find the output - 1
>>>A = [17, 24, 15, 30]
>>>A.insert( 2, 33)
>>>print ( A [-4])
3 Name the Python Library modules which need to be imported to invoke the 1
following functions:
(i) ceil() (ii) randrange()
4 Which of the following are valid operator in Python: 1
(i) */ (ii) is (iii) ^ (iv) like

3|Pag
e
5 Which of the following statements will create a tuple ? 1
(a) Tp1 = (“a”, “b”)
(b) Tp1= (3) * 3
(c) Tp1[2] = (“a”, “b”)
(d) None of these
6 What will be the result of the following code? 1
>>>d1 = {“abc” : 5, “def” : 6, “ghi” : 7}
>>>print (d1[0])
(a) abc (b) 5 (c) {“abc”:5} (d) Error
7 Find the output of the following: 1
>>>S = 1, (2,3,4), 5, (6,7)
>>> len(S)
8 Which of the following are Keywords in Python ? 1
(i) break (ii) check (iii) range (iv) while
9 is a specific condition in a network when more data packets are 1
coming to network device than they can handle and process at a time.
10 Ravi received a mail from IRS department on clicking “Click –Here”, he was 1
taken to a site designed to imitate an official looking website, such asIRS.gov. He uploaded some
important information on it.
Identify and explain the cybercrime being discussed in the above scenario.
11 Which command is used to change the number of columns in a table? 1
12 Which keyword is used to select rows containing column that match a 1
wildcard pattern?
13 The name of the current working directory can be determined using 1
method.
14 Differentiate between Degree and Cardinality. 1
15 Give one example of each – Guided media and Unguided media 1
16 Which of the following statement create a dictionary? 1
a) d = { }
b) d = {“john”:40, “peter”:45}
c) d = (40 : “john”, 45 : “peter”}
d) d = All of the mentioned above

4|Pag
e
17 Find the output of the following: 1
>>>Name = “Python Examination”
>>>print (Name [ : 8 : -1])
18 All aggregate functions except ignore null values in their input 1
collection.
a) Count (attribute) b) Count (*) c) Avg () d) Sum ()
19 Write the expand form of Wi-Max. 1
20 Group functions can be applied to any numeric values, some text types and 1

DATE values. (True/False)

21. is a network device that connects dissimilar networks.

Question PART A Marks


No. allocated

Section-I

Select the most appropriate option out of the options given for each question.
Attempt any 15 questions from question no 1 to 21.

1 Find the invalid identifier from the following : 1


a) def b) For c)_bonus d)First_Name

2 Given the lists Lst=[‘C’,’O’,’M’,’P’,’U’,’T’,’E’,’R’] , write the output of: 1

print(Lst[3:6])

3 ………………….. function of writer object is used to send data to csv file to store. 1

4 What will be the output of following program: 1


a='hello'
b='virat'
for i in range(len(a)):
print(a[i],b[i])
5 Write the output of the following code segment: 1
colors=["violet", "indigo", "blue", "green", "yellow", "orange","red"] del
colors[4]
colors.remove("blue")
colors.pop(3)
print(colors)
6 Which statement is correct for dictionary? 1

(i) A dictionary is a ordered set of key:value pair

Page 1 of 9
(ii) each of the keys within a dictionary must be unique

(iii) each of the values in the dictionary must be unique

(iv) values in the dictionary are immutable

7 Identify the valid declaration of Rec: 1

Rec=(1,‟Vikrant”,50000)

(i)List (ii)Tuple (iii)String (iv)Dictionary

8 Find and write the output of the following python code: 1


def myfunc(a):
a=a+2
a=a*2
return a
print(myfunc(2))
9 Name the protocol that is used to transfer file from one computer to another. 1

10 Raj is a social worker, one day he noticed someone has created his fake ID on 1
social media platforms for fund raising. What kind of Cybercrime Raj is facing?

11 Which command is used to change the existing information of table? 1

12 Expand the term: RDBMS 1

13 Write an Aggregate function that is used in MySQL to find No. of Rows in the 1
database Table.

14 For each attribute of a relation, there is a set of permitted values, called the ………. 1
of that attribute.
a. Dictionaries
b. Domain
c. Directory
d. Relation
15 Name the Transmission media which consists of an inner copper core and a second 1
conducting outer sheath.
16 Identify the valid statement for list L=[1,2,”a”]: 1
a. L.remove("2")
b. L.del(2)
c. del L[2]
d. del L[“a”]
17 Find and write the output of the following python code:x 1
= "Python"
print(x[ : :-1])
print(x)
18 In SQL, write the query to display the list of databases stored in MySQL. 1

19 Write the expanded form of GPS? 1

20 Which is not a constraint in SQL? 1

Page 2 of 9
a. Unique
b. Distinct
c. Primary key
d. Check

21 Define Bandwidth? 1

Question Part-A Marks


No.
Section-I
Select the most appropriate option out of the options given for each question. Attempt any 15
questions from question no 1 to 21.
1 Which of the following is not an assignment Operator? 1
i. **=
ii. /=
iii. ==
iv. %=
2 Given the lists L=[1,3,6,82,5,7,11,92] , write the output of print(L[::-1]) 1
3 What will be the output of following code snippet? 1
x="iamaprogrammer"
print(x[2:])
print(x[3:8])

Page 3 of 9
4 Identify mutable and immutable objects from the following: 1
i. List ii. String iii. Dictionary iv. Tuple
5 Suppose a tuple T is declared as T = (10, 12, 43, 39), which of the 1
following is incorrect?

a) print(T[1])
b) T[2] = -29
c) print(max(T))
d) print(len(T))

6 Declare a dictionary of toppers of your class with their name as keys 1


and marks obtained as their value.
7 A tuple is declared as T = (2,5,6,9,8) What will be the value of sum(T)? 1
8 Name the python library module which is to be imported to invoke the 1
following functions. i. cos() ii. randint()
9 Name the protocol that is used to send emails. 1
10 Your friend Ranjana complaints that somebody has created a fakeprofile 1
on Facebook and defaming her character with abusive comments and
pictures. Identify the type of cybercrime for these
situations.
11 Ms. Ravina is using a table 'customer' with custno, name, address and 1
phonenumber. She needs to display name of the customers, whose name start
with letter 'S'. She wrote the following command,which did not give the
result.
Select * from customer where name="S%";
Help Ms. Ravina to run the query by removing the errors andwrite
the correct query
12 In SQL, what is the use of LIKE operator? 1
13 What is returned by 1
SELECT SUBSTR(‘TUTORIALS POINT’, 1, 9)

14 To select the record with the smallest value of the Price column. 1
SELECT FROM Products;

15 Which of these is not an example of unguided media? 1


(i) Optical Fibre Cable (ii) Radio wave (iii) Bluetooth (iv) Satellite
16 In which of the following file modes the existing data of the file will not 1
be lost? rb, ab, w, w+b, a+b, wb, wb+, w+, r+
17 Yogendra intends to position the file pointer to the beginning of a textfile. 1
Write Python statement for the same assuming "F" is the
Fileobject.
18 In SQL, write the query to display structure of table student. 1
19 Write the expanded form of SMTP. 1
20 Which clause is similar to “HAVING” clause in Mysql? 1
a) SELECT
b) WHERE
c) FROM
d) None of the mentioned

Page 4 of 9
21 Rearrange the following terms in increasing order of data transfer 1
rates. Gbps, Mbps, Tbps, Kbps, bps

Q.No Part A Marks


Section-I
Select the most appropriate option out of the options given for each question. Attempt any 15
questions from question no 1 to 21.
1 Which one of the following is a valid identifier: 1
i. _name
ii. Roll.no
iii. while
iv. No#1
2 Write any two immutable data type of python. 1
3 Consider a 1
list
L=[1,2,[3,4],5
]
What will be the output of print(L[2]).
4 Consider a dictionary: 1
D={1: “JAN”, 2: “FEB”,3: “MAR”,4: “APR”}
Write python code to add one more key-value pair in the above dictionary with key 5
and value “MAY”.
5 Name the built-in function / method that is used to return the length of the given 1
object.
6 Identify the valid declaration of 1
Data:
Data=(1,”Flower”,”Plant”,2,3,”Tree
”)
(a)List (b) Tuple (c) Dictionary (d) String
7 Which one of the following is the valid relational operator in Python? 1
i. and

Page 5 of 9
ii. +=
iii. !=
iv. =
8 Consider a list List=[10,20,30,40], which of the following statement will result in an 1
error:
i) L[0]=L[0]+2
ii) L=L+2
iii) L=L*2
iv) L[1]=50
9 Which Switching Technique establishes a dedicated path between sender and 1
receiver?
10 Which software program helps website to store the information about visitors like 1
user name, password and other details?
11 If the following codes are executed, what will be the answer: 1

12 In MYSQL this constraint does not allow NULL Values in a column. 1


13 In RDBMS a row is also known as: 1
i. Attribute
ii. Relation
iii. Field
iv. Tuple
14 Write the output of following code: 1

15 In MYSQL, this clause is used to display the data of table in ascending or 1


descending
order.
16 In MYSQL, this command is used to add rows in a table. 1
17 With reference to the RDBMS, define Alternate Key. 1
18 Roshan wants to display the details of those students whose PHONE_NO are 1
not mentioned in table STU_DATA. He wrote the following query but not
getting the output:
SELECT * FROM STU_DATA WHERE PHONE_NO = NULL;
Help Roshan to remove the error in above query.

19 Rearrange the following terms in increasing order of their scope of network: 1


WAN,PAN,MAN,LAN
20 Harassing, Demeaning, Defaming, embarrassing or intimidating someone using 1
computer or electronic devices comes under which type of the cyber-crime?
21 Which one of the following is a malicious program that can self-replicate: 1
(i)Virus (ii) Worm (iii)Trojan Horse (iv) Spam
20 Given 1
employee={'salary':10000,'age':22,'name':'Mahesh'}
employee.pop('age')
what is output print(employee)

21 WhatisHTML? 1

Q.No. PARTA Marks


Section-
IAttemptany15questionsfromquestionno1to21.
1 Findoddoneoutfromthe following.
1
(a)* (b)/ (c)& (d) //
2 Ifs=“Courageto continue”
1
whatwillbetheoutputofprint(s.split())
3 If l= [2,3,5,[7,6],7,4] 1
Writeaslicingoperationtodisplaytheunderlinedsectionoflist.
4 Identifythemutabledatatypes?
(a) List
(b) Tuple 1
(c) Dictionary
(d) String

5 Ifd={1:”First”,2:”Second”,3:”Third”} Write
1
a command to display [1,2,3]
6 Anon-keyattribute,whosevaluesarederivedfromprimarykeyofsomeothertable.
(a)Alternate Key
(b)Foreign Key 1
(c)Primary Key
(d)CandidateKey
7 Nameanytwowirelessmobilecommunication protocols. 1
8 RJ45connectorcanbeusedtoconnect
(a)TwistedPairCable (b)OpticalFiber 1
(c)CoaxialCable (d)Radio communication
9 Whyhttpsisconsideredmoresecured? 1
10 Statetrue orfalse.
(a) XMLhaspre-definedtags. 1
(b) HTMLisacase-sensitivelanguage.

1 of 75
11 Findtheoutputof
X = 50
deffunct(X):
1
X=2
funct(X)
print(“Xisnow:”X)
12 State(True/False)
(a) ‘Having’clausegivesconditiononrows. 1
(b) count(columnname)andcount(*)wouldalwaysgivesame result.
13 Atablehas5attributesand7tuples.Whatisitsdegreeand cardinality? 1
14 Riju wanted to find the date of birth of the youngest student from a table. Suggest a n
1
aggregate function in SQL to find the youngest student.
15 Nametheattackthatencryptsthefilesanddemandsmoneyfordecryptionofthefile. 1
16 Considerthefollowingstatement. 1
Dict={“Teena”:18,”Riya”:12,“Aliya”:22}

2 of 75
Howwillyouremove“Riya”from Dict?
17 Identifythedatatypeandwriteifitismutable/immutable.
1
(a)(‘a’,’e’,’I’,’o’,’u’)
18 WhichkeywordofSQLisusedtoselectuniquevaluesfromacolumn? 1
19 The traditional telephone system follows switching
1
technique.
20 WritethefullformofDMLandDDL. 1
21 A canreplicateitselfwithoutanyhumaninteraction,andit
doesnotneedtoattachitselftoasoftwareprograminordertocausedamageto computer. 1

Section I
Select the most appropriate option out of the options given for each question. Attempt any 15
questions from question no 1 to 21.
1 Find the valid identifier from the following 1
a) My-Name b) True c) 2ndName d) S_name
2 Given the lists L=[1,3,6,82,5,7,11,92] , 1
What will be the output of
print(L[2:5])
3 Write the full form of IDLE. 1
4 Identify the valid logical operator in Python from the following. 1
a) ? b) < c) ** d) and
5 Suppose a tuple Tup is declared as Tup = (12, 15, 63, 80), which 1
of the following is incorrect?
a) print(Tup[1])
b) Tup[2] = 90
c) print(min(Tup))
d) print(len(Tup))
6 Write a statement in Python to declare a dictionary whose keys are 1,2,3 and values are Apple, Mango 1
and Banana respectively.
7 A tuple is declared as T = (2,5,6,9,8) 1

Page 1 of 6
What will be the value of sum(T)?
8 Name the built-in mathematical function / method that is used to return square root of a number. 1
9 Protocol is used to send email ……………………………… 1
10 Your friend Sunita complaints that somebody has created a fake profile on Twitter and defaming her 1
character with abusive comments and pictures. Identify the type of cybercrime for these situations.
11 In SQL, name the command/clause that is used to display the rows in descending order of a column. 1
12 In SQL, what is the error in following query : 1
SELECT NAME, SAL, DESIGNATION WHERE DISCOUNT=NULL;
13 Write any two aggregate functions used in SQL. 1
14 Which of the following is a DML command? 1
a) SELECT b) Update c) INSERT d) All
15 Name the transmission media best suitable for connecting to desert areas. 1
16 Identify the valid declaration of P: 1
P= [‘Jan’, 31, ‘Feb’, 28]
a. dictionary b. string c.tuple d. list
17 If the following code is executed, what will be the output of the following code? 1
str="KendriyaVidyalayaSangathan"
print(str[8:16])
18 In SQL, write the query to display the list of databases. 1
19 Write the expanded form of VPN. 1
20 Which of the following will suppress the entry of duplicate value in a column? 1
a) Unique b) Distinct c) Primary Key d) NOT NULL
21 Rearrange the following terms in increasing order of speedy medium of data transfer. 1
Telephone line, Fiber Optics, Coaxial Cable, Twisted Paired Cable

Section-I
Select the most appropriate option out of the options given for
eachquestion.Attemptany15questionsfromquestionno1to
21.
1 Findthevalididentifierfromthefollowing 1
a. 12myschool
b. Class_
c. My*school
d. Myschool123
2 Whatwillbetheoutputofthefollowing? a=[1,2,3] 1
b=[2,3]
c=2
a.extend(b)
print(a)
a.append(c)
print(a)

Page 2 of 6
3 Rearrangethefollowingtermsinincreasingorderofdata transfer 1
rates.
Gbps,Mbps,Tbps,Kbps,Bps
4 WhichofthefollowingisavalidExponentiationoperatorin Python? 1
a. //
b. %
c. **
d. /

5 Consideratuple 1
T=(1,2,3)
Takeaninteger‘n’fromuserandaddinteger‘n’tothetuple. For eg if
n=12.
ThenafterexecutionofstatementT=(1,2,3,12)
6 Write a statement in Python to declare a dictionary with keys as1 1
2 and 3 and values as “Monday”, ”Tuesday”, ”Wednesday”. After
declaring ,write statements to print the key and value inthe
following format
1 ..... Monday
2 ..... Tuesday
3 ..... Wednesday

7 Atupleisdeclaredas T 1
= (2,5,6,9,8)
Writeastatementtodeletethe tuple.

8 Namethebuilt-inmathematicalfunction/methodthatisused to 1
return the remainder of x/y

9 NametheprotocoloftenusedforDialUpconnections? 1
10 Copyinginformationfromawebsiteorprintedmaterialand 1
pretendingitis yours is anexampleof ?

Page 3 of 6
11 The operatorisashorthandformultiple OR 1
conditionsinSQL.
12 The statementisusedtomodifytheexisting 1
recordsinatableinSQL.
13 Except for aggregatefunction,allother 1
aggregatefunctionsignorenullvalues
14 WhichofthefollowingareDMLcommands? 1
a)INSERTb)ALTERc)CREATEd)UPDATE
15 Nameanytwowirelesstransmissionmedia? 1
16 Consider the following list 1
n_list=["Happy",[2,0,1,5]]
Writeapythonstatementtoprint2fromthenested list.
17 Ifthefollowingcodeisexecuted,whatwillbetheoutputofthe 1
following code?
String='ASTRING'
print(String[1:5:2])
18 Using commandinSQLweareabletosee 1
thestructureofatable.
19 Writetheexpandedformof WiMax. 1
20 The constraintinSQLspecifiesthatthe 1
column cannot have NULL or empty values in table.

21 filemodeopensafileforreadingonlyin 1
binaryformat.

You might also like