Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
23.0k views
in Computer by (46.3k points)
closed by

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 Lower and Upper.

import random AR=[20,30,40,50,60,70]; 

Lower =random.randint(1,3) 

Upper =random.randint(2,4) for K in range(Lower, Upper +1): 

print (AR[K],end=”#“) 

(i) 10#40#70# 

(ii) 30#40#50# 

(iii) 50#60#70# 

(iv) 40#50#70#

1 Answer

+2 votes
by (49.3k points)
selected by
 
Best answer

OUTPUT: (ii) 

Maximum value of Lower: 3 

Maximum value of Upper: 4

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...