Comp 12 Ms-Revised
Comp 12 Ms-Revised
SECTION - A
1. True 1
2. (d) & 1
3. (b) L.insert (4,45) 1
4. (a) True 1
5. (c) Pyton 1
6. (d) ‘wb’ 1
7. (b) UPDATE 1
8. (a) % 1
9. (b) T[3]=35 1
10. (d) All of the above 1
11. (a) <name of reader object> = csv.reader(<file handle>) 1
12. (b) SELECT * FROM PERSONS ORDER BY FirstName DESC 1
13. (d) TCP 1
14. (a) 2 1
15. (c) COUNT(<col name>) will return number of NULL values in the given 1
column
16. (b) connect() -> cursor() -> execute() 1
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. (a)Both A and R are true and R is the correct explanation for A 1
18. (b)Both A and R are true and R is not the correct explanation forA 1
SECTION - B
2
19. N=10
for i in range(0,N): #Error 1
if i%4==0: # Error 2
print(i*4)
elif i%5==0: # Error 3
print(i+3)
else: #Error 4
print(i+10)
20. 2
IP v4 Address IP v6 Address
IP v4 Addresses are 32 bit IP v4 Addresses are 128 bit
addresses addresses
IP v4 format is IP v6 format is
x.x.x.x where x ranges from 0 y:y: y:y: y:y: y:y where y ranges
to 255 from 0000 to FFFF
OR
Static Webpage Dynamic Webpage
Static Web pages are written Dynamic Web Pages are
in languages such as HTML, written in languages such as
JavaScript, CSS, etc. CGI, AJAX, ASP, ASP.NET,
etc.
In Static web pages the In dynamic web pages, the
content of pages is same for Content of pages is different
different users. for different users.
(OR)
SELECT column1, column2, ...
FROM table_name
WHERE condition;
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
SECTION - C
26. 1+2
CustomerID OrderNo
1 77890
2 23653
Name Marks
Anvitha 93
Gurpreet Kaur 85
Shreya 81
MIN(Marks) MAX(Marks)
70 93
Name
Nanak ram
Praful Patel
def countWords():
f=open("story.txt",'r')
s=f.read()
words=s.split()
count=0
for word in words:
if len(word)<5:
count=count+1
print("The number of words with length less than 5: ",count)
28. (a) 3
TID NAME DEPT
103 DEVRAJ MATHS
105 ABHIGNA MATHS
107 KIRAN COMPUTER
CLASS COUNT(*)
12 5
11 5
DEPT
COMPUTER
HISTORY
MATHS
Failed_list=[]
def Push(Stu):
for key in Stu.keys():
if Stu[key]<33:
Failed_list.append(key)
SECTION - D
31. (a) Any correct layout 5
(b) main
(c ) Switch / Hub in every building
Repeater between Main and Finance buildings ( only if cable layout is
there between those two buildings)
(d)Modem to be connected at the server
(e ) Firewall to be connected at the server.
32. (a) 31 2+3
17
(b # statement 1
mysql.connector
# statement 2
mydb.cursor()
# statement 3
mydb.commit()
(OR)
(a){'E': 1, 'x': 1, 'c': 1, 'e': 2, 'l': 2, 'n': 1, 't': 1}
(b) i) mysql.connector.connect #blank1
ii) execute #blank2
iii) mydb.commit() #blank3
33. newline with open() will ensure that no translation of end of line (EOL) takes 5
place .
import csv
def Addrecord():
f=open("Student.csv","a",newline="")
wr=csv.writer(f)
admno=int(input("Ente admission no: "))
name=input("Enter name :: ")
Class=int(input("Enter Class: "))
L=[admno,name,Class]
wr.writerow(L)
f.close()
def count():
f=open("Student.csv","r",newline="")
data=csv.reader(f)
d=list(data)
print(len(d))
f.close()
Addrecord()
count()
(OR)
CSV file are easier to create. Capable of storing large amounts of data.
import csv
f=open("Employee.csv","a",newline="")
wr=csv.writer(f)
empdata=[["Rahul","Assistant",34000],
["Abhinav","Manager",67000],
["John","Clerk",23000],
["Vinod","Accountant",32000],
["Mahitha","Clerk",28000]]
wr.writerows(empdata)
f.close()
SECTION - E
34. (i) SNO as it is having unique values 1+1
(ii) 2 (SNO,AADHAR) +2
(iii)
(a) INSERT INTO PERSONS VALUES(8, ‘MANOHAR’,
‘HYDERABAD’, 712365430907);
(b)UPDATE PERSONS SET CITY=’MUMBAI’ WHERE SNO=5;
(OR)
(a)SELECT * FROM PERSONS ORDER BY NAME;
(b)ALTER TABLE PERSONS ADD EMAIL CHAR(25);
35. (i)pickle 1+1
(ii)rb+ +2
(iii) (a) load (b)dump