Professional Documents
Culture Documents
SECTION A
1. c. a b c=100 200 300 1
2. (b) ** 1
3. c) Error 1
5. (c ) Welcom Friends 1
7. (c) references 1
8. (d) delete 1
9. (a) start(10) 1
11. (a) Move file pointer five characters ahead from the current position 1
1 (c) 241212 1
4.
1 c) total 1
5.
1 (d) fetchone 1
6.
1 e. A is false but R is True 1
7.
18. b. Both A and R are true and R is not the correct explanation for A 1
SECTION B
1 Correct the following code segment: 2
9. def say(message, times = 1):
print(message * times , end = ’ ‘)
say(‘Hello and’,times=10)
say('World')
2 2
0. Any two point of difference
. OR
2 2
5.
Find output:
(a)
PID PNAM QTY PRIC COMPAN SUPC SUPC SNA CITY
E E Y ODE ODE ME
101 DIGITA 120 120 RENBIX S01 S01 GET KOLK
L 00 ALL ATA
CAME IN
RA 14X
102 DIGITA 100 220 DIGI POP S02 S02 DIGI CHEN
L PAD 00 BUSY NAI
11I GROU
P
104 PENDR 500 110 STOREKI S01 S01 GET KOLK
IVE 0 NG ALL ATA
16GB IN
106 LED 70 280 DISPEXP S02 S02 DIGI CHEN
SCREE 00 ERTS BUSY NAI
N 32 GROU
P
105 CAR 60 120 MOVEON SO3 SO3 EASY DELHI
GPS 00 MAR
SYSTE KET
M CORP
(b)
PID PNAME QTY PRIC COMPANY SUPCO SNAM CITY
E DE E
101 DIGITAL 120 1200 RENBIX S01 GET KOLKA
CAMER 0 ALL IN TA
A 14X
102 DIGITAL 100 2200 DIGI POP S02 DIGI CHENN
PAD 11I 0 BUSY AI
GROU
P
104 PENDRI 500 1100 STOREKIN S01 GET KOLKA
VE G ALL IN TA
16GB
106 LED 70 2800 DISPEXPE S02 DIGI CHENN
SCREEN 0 RTS BUSY AI
32 GROU
P
105 CAR 60 1200 MOVEON SO3 EASY DELHI
GPS 0 MARK
SYSTEM ET
CORP
SECTION C
0.5 X4
(b) Write the output of the queries (a) to (d) based on the table, Staff
given below:
Table: Staff
(a) 5.66
(b) 12-01-2006
(c) 3 Christina 15-11-2009 Sales F 12
7 habeena 16-08-2011 Sales F 10
(d) Dima 03-05-2016
Danish 11-09-2013
27. f1=open(“TEXT1.TXT”) 3
f2=open(“TEXT2.TXT”,”w”)
data=f1.read().split()
for word in data:
if word[0] not in “AEIOU”:
f2.write(word, “ “)
f1.close()
f2.close()
OR
f1=open(“TEXT1.TXT”)
data=f1.readlines()
for line in data:
if line.strip()[-1]==”a”:
print(line)
f1.close()
28. Create table Employee(Empid int(5) primary key, Empname char(25) not 3
null, Design char(15) unique , Salary float, DOB date);
29. def merge_tuple(t1,t2): 3
t3=( )
if len(t1)==len(t2):
for i in range(len(t1)):
t3[i]=t1[i]+t2[i]
return t3
return -1
def pop(stack):
if stack==[ ]:
print(“underflow”)
else:
print(stack.pop())
OR
def push(l, stack):
for ele in l:
if ele<0:
stack.append(ele)
def pop(stack):
if stack==[ ]:
print(“underflow”)
else:
print(stack.pop())
SECTION D
31. (a) Star topology , optical fibre or coaxial
(b) S wing as it has maximum no. of computers resulting in
maximum internal traffic as per 80:20 rule
(c) hub/Switch should be place in all the wings
(d) WiFi Router OR WiMax OR RF Router OR Wireless Modem OR
RFTransmitterRead more on Sarthaks.com -
33. (any 2) 5
CSV is human readable and easy to edit manually.
CSV is simple to implement and parse.
CSV is processed by almost all existing applications.
CSV provides a straightforward information schema.
CSV is faster to handle.
CSV is smaller in size.
CSV is considered to be standard format.
Write a program to
(a)
(b) f=open(“data.csv”,”r”)
data=csv.reader()
If row[2]==Cls:
print(row)
OR
I.
import pickle
def CreateEmp():
f1=open("emp.dat",'wb')
eid=input("Enter E. Id")
ename=input("Enter Name")
designation=input("Enter Designation")
salary=int(input("Enter Salary"))
l=[eid,ename,designation,salary]
pickle.dump(l,f1)
f1.close()
II.
import pickle
def display():
f2=open("emp.dat","rb")
while True:
try:
rec=pickle.load(f2)
print(rec['eid'],rec['ename'],rec['designation'],rec['salary'])
except EOFError:
break
f2.close()
SECTION E
34 (a) degree = 9 cardinality = 20 1+1+2
(b) degree = 8 cardinality = 28
(c) (i) Select Name, fare, f_date from passenger p, flight f where
p.fno=f.fno and start=”DELHI”;
(ii) delete from flight where end=”MUMBAI”;
OR
(c) Create table traveller as select * from passenger;
35. I. d) import 5
II. c) csvwriter
III. d) rec
IV. b) customer.csv
V. d) rec