B01F-2017 – Computer Sir Ki Class

Login


Lost your password?

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

Login
[lwa]



Exam Questions-CBSE12D-2017-B01F #PYTHON#6402    siteicon   siteicon  

Problem Statement - B01F-2017

What are the possible outcome(s) executed from the following code? Also specify the maximum and minimum values that can be assigned to variable N. import random

SIDES=["EAST","WEST","NORTH","SOUTH"];
N=random.randint(1,3)
OUT=""
for I in range(N,1,-1):
    OUT=OUT+SIDES[I]
print OUT
(i) SOUTHNORTH   (ii) SOUTHNORTHWEST
(iii) SOUTH      (iv) EASTWESTNORTH

Solution

TC++ #6402

(i) SOUTHNORTH
Maximum value of N = 3
Minimum value of N = 1


Share

CSKC| Created: 12-Jan-2019 | Updated: 12-Jan-2019|CBSE12D-2017









Back