1.

Write the output i=10 while(i>=6): print(i,end=’\t’) i=iAnswers please​

Answer»

Given PROGRAM:

i=10  

while(i>=6):

   print(i,end="\t")

   i = i

In the above program, the LOOP will not terminate because the VALUE of i will always be EQUAL to 10 and because of this the terminating CONDITION will never get satisfied.

So, it will print 10 on the whole screen.

To terminate the loop, we need to do some changes in the program.

Now new program is:

i=10  

while(i>=6):

   print(i,end="\t")

  i = i - 1

The output of the above program will be now:

10     9     8     7     6



Discussion

No Comment Found