Computer Science, asked by rishabh203526, 10 months ago

plz write a program of python in notepad mode​

Attachments:

Answers

Answered by Equestriadash
5

n = 0

while n < 11:

   print(n, "x 2 = ", n*2)

   n = n + 1

When using a while loop, there must be a condition given for it to keep looping.

Here, the condition given was n < 11.

n's value is 0. So as long as 0 is less than 11, it will keep looping.

For programs like this, it's necessary for the value of n to increment. Hence the last statement, where we increment n by 1. So it will keep incrementing by 1, until it reaches a point where n is no longer less than 11.

Once it reaches that point, the loop is over.

Attachments:
Similar questions