Page 255 - C++
P. 255
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)
(2 marks for correct option)
NOTE:
Deduct ½ mark each for wrong options
(b) Name the Python Library modules which need to be imported to invoke the 1
following functions
(i) ceil() (ii) randint()
Ans (i) math (ii) random
(½ Mark for writing each correct Library modules)
NOTE:
Ignore any other Library modules, if mentioned
(c) Rewrite the following code in python after removing all syntax error(s). Underline 2
each correction done in the code
TEXT=""GREAT
DAY""
for T in range[0,7]:
print TEXT(T)
print T+TEXT
Ans TEXT="GREAT"
DAY =""
for T in range(0,7):
print TEXT[T]
print T,TEXT
Also range(0,7) will give a runtime error as the index is out of range. It should
be range(0,5)
(½ Mark for each correction, not exceeding 2 Marks)
OR
(1 mark for identifying the errors, without suggesting corrections)
(d) Find and write the output of the following Python code: 2
STR = ["90","10","30","40"]
COUNT = 3
SUM = 0
for I in [1,2,5,4]:
S = STR[COUNT]
SUM = float (S)+I
print SUM
COUNT-=1
Ans 41.0
32.0
15.0
94.0
( ½ mark for each correct line of output)
NOTE: Deduct ½ Mark for writing the answer in same line. Deduct ½ Mark for
writing numbers without decimal point
(e) Find and write the output of the following python code: 3
class ITEM:
def __init__(self,I=101,N="Pen",Q=10): #constructor
Page #14 of 28