What will be the output of the following code:

n = 3

for i in range(n):

  for j in range(n-i):

    print(j+1, end="")

  print()

Options:

a)123

   12

   1

b)321

   21

   1

c)123

   23

   3

d) None of the above

Answer:

Answer by student

a) 123

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 and Computer Science at Teachoo