Professional Documents
Culture Documents
MARKING SCHEME
SECTION - A
1 State True or False: “Keywords cannot be used as identifiers in Python.” 1
Ans: True
2 Which of the following is an invalid identifier in Python? 1
(a) false (b) False (c)true (d) IF
Ans: (b) False
3 Given the following dictionaries 1
dict_exam={"Exam":"AISSCE", "Year":2023,"Total":500,
"Pass_Marks":165}
a. dict_exam.itmes()
b. exam.values()
c. dict_exam.keys()
d. dict_exam.items()
Ans : ( c) dict_exam.keys()
4 What will be the output of the following statement: 1 (1)
print(3-10**2+99/11)
(a) 80 (b) - 81 (c) -88 (d) - 81.0
Ans: (c) -88
5 What will be the output of the following code? 1
Str1="My name is digital"
Str2=Str1[3:7]
strlen = len(Str2)
print(strlen)
(a) 4 (b) 14 (c) 24 (d) 34
Ans: (a) 4
6 In which of the following only write mode is allowed ? 1
(a) ab (b) r+ (c) w+ (d) None of the above
Ans : (a) ab
7 Fill in the blank: 1
______ keyword is used to display non-repeated values in MySQL.
(a) Unique (b) Remove (c) Distinct (d) All
Ans: (c) Distinct
8 Which of the following command is used for modifying a record from a table ? 1
(a) ALTER (b)UPDATE
KVS RO KOL – PB 2 – XII – COMP. SCI. – 2022-23 Page 1
(c) CHANGE (d) MODIFY
Ans : (b) UPDATE
9 Which of the following statement(s) would give an error after executing the following 1
code?
tup = (20,30,40,50,80,79)
print(tup) #Statement 1
print(tup[3]+50) #Statement 2
print(max(tup)) #Statement 3
tup[4]=80 #Statement 4
(a) Statement 1 (b) Statement 2 (c) Statement 3 (d) Statement 4
Ans: (d) Statement 4
10 Fill in the blank: 1
Cartesian product of two table will contain ______ of rows and ________
of column.
(a) Sum , Product
(b) Product , Sum
(c) Difference , Product
(d) Sum , Sum
Ans : b) Product , Sum
11 Which of the following is the correct syntax of file object ‘fobj’ to write sequence 1
data type using writelines() function? (1)
(a) file.writelines(sequence)
(b) fobj.writelines()
(c) fobj.writelines(sequence)
(d) fobj.writeline()
Ans: (c) fobj.writelines(sequence)
12 In MySQL, what is the use of column alias ? 1
(a) Giving a new name to the output column (b) Renaming a column
(c) Renaming a row (d) None of these
Ans: (a) Giving a new name to the output column
13 Fill in the blank: 1
is a communication protocol used by email clients to retrieve email messages
from mail servers
(a) PPP (b) SMTP (c) VoIP (d)POP
Ans : d ) POP
14 What will the following expression is an iterable in Python ? 1
(a) int (b) string (c) boolean (d) None of these
Ans: (b) string
15 Which of the following function will ignore NULL value in MySQL ? 1
(a) count(<attribute>) (b) sum() (c) count(*) (d) None of these
Ans: (c)count(*)
16 which of the following is used for checking successful connection of 1
database with connected object
a) is_connected () b) is_cursor ()
KVS RO KOL – PB 2 – XII – COMP. SCI. – 2022-23 Page 2
c)if_fetch() d) is_connect()
Ans: (a) ) is_connected ()
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): Function can take input values as parameters, execute them and 1
return output (if required) to the calling function with a return statement. (1)
Reason (R): A function in Python can return multiple values in the form of
tuple.
Ans: (b)
18 Assertion (A): Modules provide reusability of code. 1 (1)
Reason (R): We can define a module and import it for reusing without copying their
definitions into different programs.
Ans: (a)
SECTION - B
19 Kumar has written a code to input a number and check whether it is composite or 2
not. His code is having errors. Rewrite the correct code and underline the corrections
made.
def prime():
n=int(input("Enter number to check :: ")
for i in range (2, n//2):
if n%i=0:
print("Number is a composite number\n")
break
else:
print("Number is prime \n’)
Ans:
def prime():
n=int(input("Enter number to check :: ") )
for i in range (2, n//2):
if n%i==0:
print("Number is a composite number\n")
break
else:
print("Number is prime \n”)
20 What is use of MODEM and Repeater? 2
Ans:
MODEM – coverts analog signal to digital signal and vice-versa.
Repeater – Regenerates signals
OR
OR
Write the output of the given code:
t1=(10,20,"book",30,9.5,"item",[12,13],(3,4),30,5,30)
print(t1.index(20))
OR
Write two examples for each of following
DDL , DML
Ans:
DDL : ALTER, DROP
DML: INSERT, UPDATE
SECTION-C
26 (a) 1
Consider the following tables – CARDEN and CUSTOMER: +
2
(b)
Write the output of the queries (i) to (iv) based on the table, STOCK given below:
Write a method COUNTWORD() in Python to read words from text file 'TESTFILE.TXT’
and count the words which are not starting with any vowel.
Example:
If the file content is as follows:
An apple a day keeps the doctor away.
We all pray for everyone’s safety.
A marked difference will come in our country.
The COUNTWORD() function should display the output as:
No. of words not starting with vowel is 8
Ans:
def COUNTWORD():
c=0
f=open("TESTFILE.TXT")
d=f.read()
w=d.split()
for i in w:
if i[0] not in 'AEIOUaeiou':
c+=1
print("No. of words not starting with vowel is ",c)
28 (a) Write the outputs of the SQL queries (i) to (iv) based on the relations 2
MOBILEMASTER & MOBILESTOCK given below: +
1
SECTION - D
31 5
(i) What will be the most appropriate block, where ABC should plan to install
their server?
(ii) Which type of topology is best suited for above network
(iii) What will be the best possible connectivity you will suggest to connect the
new setup of offices in Chennai with its London based office?
(iv) Which device will be suggested by you to connect each computer in each of
the buildings?
(v) The company once internet accessibility in all the blocks. What would the
suitable and cost effective technology for that ?
Ans:
(i) Finance block
(ii) LAN
(iii) Satellite
(iv) Hub / Switch
(v) Broadband
32 2
+
3
a=20
b=8
sum(a,b)
res=sum(r=7,q=1)
print(res)
(b) The code given below inserts the following record in the table Fun_City:
Ticket_Id – integer
Name – string
Ticket_Price – integer
No_Of_Tickets – integer
Total_Amount – integer
Note the following to establish connectivity between Python and MySQL:
• Username is root
• Password is Ticket
• The table exists in a MySQL database named Amusement.
• The details (Ticket_Id, Name, Ticket_Price, No_of_Tickets) are to be
accepted by the user. Write the following missing statements to complete
the code:
Statement 1 – To form the cursor object
Statement 2 – Write a command to execute the command
Statement 3 – Write a command to save data permanently in the database.
Ans:
Statement 1 – mycursor=con.cursor()
Statement 2 – mycursor.execute(query)
Statement 3 – mycursor.execute(“Commit”)
OR
Ans: wELCcME**bye**
(b) The code given below reads the following record from the table
named Employee and displays only those records who have a Salary greater
than 75000:
• EmpNo – integer
• EmpName – string
• Designation – string
• Salary – integer
Note the following to establish connectivity between Python and MySQL:
• Username is root
• Password is sales_emp
• The table exists in a MySQL database named “Office”.
Write the following missing statements to complete the code:
•Statement 1 – To form the cursor object
•Statement 2 – To execute the query that extracts records of those employees
whose salaries are greater than 75000.
•Statement 3 – To read the complete result of the query (records whose salaries are
greater than 75000) into the variable ‘data’.
SECTION - E
34
***