Class 12 - Computer Science (083) - CE - MS
Class 12 - Computer Science (083) - CE - MS
3. c) <class ‘NoneType’>
4. b) t.insert(2, 3)
5. c) 1
6. IN
8. b) Star topology
9. c) Bridge
11. b) Pickle
13. c) CALC(y=25)
14. Sunil
15. a) S[::-5]
17. age must be a positive integer and greater than or equal to 18.
1/6
Section – B 7 x 2 = 14
22. a) x = Data[“students”]
for i in x:
print(i[“first name”]) carries 1 mark
b) x = Data[“students”]
y = Data[“teacher”]
print(len(x) + len(y)) carries 1 mark
23. i) a) Mutable object can be updated where as immutable can not be updated. 1 mark
(or)
b) False carries 1 mark
2/6
(or)
Section – C 3x3=9
29. a) Garment = {'1':['shirt',6500], '2':['trouser',2000], '3':['coat', 15000]}
s=[]
def Pushitems(Garment): push function carries 1 mark
for i in Garment.values():
if i[1]>=5000:
s.append(i)
def Popitems(): pop function carries 1 mark
print(s)
if s==[]:
print("empty")
else:
s.pop()
x=len(s)-1 display carries 1 mark
while x>=0:
print(s[x])
x=x-1
(or)
b) perfectstack = []
def pushperfect(n): push function carries 1 mark
sum=0
for i in range(1,n):
if n%i==0:
sum += i
if sum == n:
perfectstack.append(n)
def popperfect( ): pop function carries 1 mark
if perfectstack == []:
print("Stack empty")
else:
a=perfectstack.pop()
print("element deleted=",a)
x=len(perfectstack)-1
while x>=0:
print(perfectstack[x])
x-=1
ans='y'
while ans=='y':
n=int(input("Enter a number"))
pushperfect(n) each function calling carries ½ mark
ans=input("Do you want to continue")
popperfect()
or any relevant answer
30 a) 1 $
1$2$ each line carries 1 mark
3/6
1$2$3$
(or)
b) [1, 2, 3, 4, 5, 6, 7, 8, 9] each line carries 1 mark
[0, 1, 2, 3, 4]
[1, 3, 5, 7, 9, 4]
Section – D 4 x 4 =16
32. import mysql.connector as m - ½ marks
c = m.connect(host="localhost", user="admin",
password="student", database="college") - 1 mark
cursor=c.cursor() - ½ mark
cursor.execute("UPDATE Collegestuds SET Grade= “A”
WHERE Points > 8”) – ½ mark
c.commit() - ½ mark
cursor.execute("UPDATE Collegestuds SET Grade= “B”
WHERE Points <=8”) – ½ mark
c.commit() - ½ mark
c.close()
or any relevant answer
iii) UPDATE Salesman SET Commission = Commission + 0.5 WHERE City= “Delhi”;
iii) SELECT Name FROM Patients WHERE Gender=”F” and Age is NULL;
ii) 2
6/6