Help me in solving PYTH94 problem

My issue

I can’t understand this problem. Needed a better explanation

My code

# Solution as follows

a = 0
while a < 7:
    print(a)
    a = a + 1

Learning course: Learn Python
Problem Link: CodeChef: Practical coding for everyone

Hi @haritha_646 ,
The task given to you was to:
Initialize a as 0.
Print a in separate lines as long as it is less than 7.
And Increment a by 1 in each iteration.

The code that you have written is correct it means until the value stored in a has magnitude less than 7 a will be printed on the screen and a will be incremented.
As soon as a becomes greater than or equal to 7 then the condition in while loop becomes false hence the loop will break and the program will end.
If this problem is still not clear to you then please refer the documentation on while loop on W3Schools