Predict the output of the following code?

for i in range(6):

for j in range (5):

If (i + 1==j or j+i== 4):

print(“+”, end="")

else:

print (“0”, end="")

print()

 

Answer:

[Class 11] Predict the output of the following code - Flow of Control - Short Answer Type Questions (2/3 Marks each)

Output:

0+00+

00++0

00++0

0+00+

+0000

00000

Remove Ads
Teachoo · Class 11 Explore Class 11
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh is an IIT Kanpur graduate and has been teaching for 16+ years. At Teachoo, he breaks down Maths, Science and Computer Science into simple steps so students understand concepts deeply and score with confidence.

Many students prefer Teachoo Black for a smooth, ad-free learning experience.