Computer Science - Class 12
Solutions to CBSE Sample Paper - Computer Science Class 12

What possible outputs will be obtained when the following code is executed: 

import random 

myNumber = 4

FRUIT = ["APPLE","BANANA","ORANGE","KIWI","MANGO"] 

for I in FRUIT: 

    for J in range (myNumber): 

        print(I,end="+") 

    print()

Options: 

a) APPLE+ 

BANANA+BANANA+ 

ORANGE+ORANGE+ORANGE+ 

KIWI+KIWI+KIWI+KIWI+ 

MANGO+MANGO+MANGO+MANGO+MANGO+ 

b) APPLE+ 

BANANA+BANANA+BANANA+ 

ORANGE+ORANGE+ORANGE+ORANGE+ 

KIWI+KIWI+KIWI+KIWI+KIWI+ 

MANGO+ 

c) APPLE+APPLE+APPLE+APPLE+ 

BANANA+BANANA+BANANA+BANANA+ 

ORANGE+ORANGE+ORANGE+ORANGE+ 

KIWI+KIWI+KIWI+KIWI+ 

MANGO+MANGO+MANGO+MANGO+ 

d) APPLE+ 

BANANA+ 

ORANGE+

Answer:

Answer by student

c) APPLE+APPLE+APPLE+APPLE+

BANANA+BANANA+BANANA+BANANA+

ORANGE+ORANGE+ORANGE+ORANGE+

KIWI+KIWI+KIWI+KIWI+

MANGO+MANGO+MANGO+MANGO+

Detailed answer by teachoo

The rest of the post is locked. Join Teachoo Black to see the full post.

Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.