B01F – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  

Login
[lwa]



Exam Questions-CBSE12A-2018-B01F #PYTHON#6107    siteicon   siteicon  

Problem Statement - B01F

What possible outputs(s) are expected to be displayed on screen at the time of execution of the program from the following code? Also specify the maximum values that can be assigned to each of the variables BEGIN and LAST.

import random
POINTS=[20,40,10,30,15];
POINTS=[30,50,20,40,45];
BEGIN=random.randint(1,3)
LAST=random.randint(2,4)
for C in range(BEGIN,LAST+1):
print POINTS[C],”#”,

(i) 20#50#30#           (ii) 20#40#45#
(iii) 50#20#40#         (iv) 30#50#20#

Solution

TC++ #6107

(ii) 20#40#45# and      (iii) 50#20#40#

Max value for BEGIN 3
Max value for LAST 4


Share

CSKC| Created: 9-Jan-2019 | Updated: 9-Jan-2019|CBSE12A-2018









Back