ms_csxii_pb1_set3
ms_csxii_pb1_set3
1 True 1
3 False 1
4 a. 4 1
5 a. -a-ssistance 1
6 b. ‘python’+2 1
7 c. L.del(3) 1
9 d. Primary key 1
11 d. 1
12 a. 21, 7 1
13 b. 13, 8 1
14 d. show tables 1
Page 1 of 9
15 b. delete 1
17 d. PAN 1
18 c. NIC Card 1
19 a. Packets 1
21 b. Both A and R are true and R is not the correct explanation for 1
A
22 a. Boolean 2
b. String
c. Float
d. Int
23 27 2
24 A. 1. S1.isdigit() 2
2. del L1[3:8]
B. 1. Exam.append(‘computer science’)
2. Exam.sort(reverse=True)
25 (a) 41 $ 38 $ 38 $ 37 $ 2
(d) 40 $ 37 $ 39 $ 35 $
Maximum value of Num when P = 7 : 41
Minimum value of Num when P = 7 : 35
26 def checkval ( ): 2
Page 2 of 9
x = int( input("Enter a number") )
if x % 2 == 0:
elif x<0:
else:
B. Set of rules
29 def show_words(): 3
f=open('d://notes.txt','r')
Page 3 of 9
for i in f.read():
print(i.upper(),end='')
show_words()
OR
def read_story():
f=open('d://notes.txt','r')
for i in f.read().split():
if i[-1].lower()=='h':
print(i)
read_story()
30 stk=[] 3
Lst=[2,5,6,8,24,32]
def PushE1(Lst):
for x in Lst:
if x % 4 ==0 :
stk.append(x)
def popE1( ):
if len(stk)==0 :
print(‘Underflow’)
else:
print(stk.pop(), ‘ is deleted’)
OR
Page 4 of 9
msg='All the Best for your Pre-Board Examination'
stk=[]
def pushData():
for i in msg:
if i.isupper():
stk.append(i)
def popData():
while stk:
print(stk.pop(),end='')
else:
print('\nEnd of stack')
pushData()
popData()
31 S1U3E5Ts
OR
a*!
Page 5 of 9
32 4
OR
33 a. 4
import csv
def search():
f=open('d://testcsv.csv','r')
fobj=csv.reader(f)
next(fobj)
for i in fobj:
if int(i[3])>1000:
print(i)
Page 6 of 9
b.
import csv
def countR():
f=open('d://testcsv.csv','r')
fobj=csv.reader(f)
next(fobj)
sum=count=0
for i in fobj:
count=count+1
sum=sum+int(i[4])
countR()
35 import mysql.connector as BD 4
def Emp_Database():
Page 7 of 9
con=BD.connect(host="localhost", user="root",
password="bharat", database="TOUR")
BDcursor=con.cursor()
TravelRec=BDcursor.fetchall()
print(rec)
36 import pickle 5
f1=open(‘Result.dat’,’ab’)
while True:
St_name=input("Enter name:")
Game_Name=input("Enter Salary:")
pickle.dump(data,f1)
if Choice.upper()=='N':
Page 8 of 9
break
f1.close()
OR
import pickle
fout=open("Result.dat",'rb')
try:
while True:
data = pickle.load(fout)
if data[3].lower()== ‘won’:
print(data)
except EOFError:
fout.close()
(b) WAN
Page 9 of 9