The while Statement :-
while statement Python का एक Iterative Control Statement (दोहराव नियंत्रण कथन) है। इसका उपयोग किसी statement या statements के समूह को बार-बार execute करने के लिए किया जाता है, जब तक दी गई condition True (सही) रहती है।
यदि condition True होती है, तो while के अंदर लिखा code execute होता है और condition को फिर से check किया जाता है। जब condition False (गलत) हो जाती है, तो while loop समाप्त हो जाता है।
Python में while statement के अंदर लिखे code को Indentation (रिक्त स्थान) देना आवश्यक होता है। Indentation यह बताता है कि कौन-सा statement while block के अंदर है। सामान्यतः Python में 4 spaces का indentation प्रयोग किया जाता है।
English
The while statement is an iterative control statement in Python. It is used to execute a statement or group of statements repeatedly as long as the given condition remains True.
If the condition is True, the statements inside the while block are executed, and the condition is checked again. When the condition becomes False, the while loop terminates.
In Python, the code written inside a while statement must be given Indentation (spaces). Indentation indicates which statements are part of the while block. Generally, 4 spaces are used for indentation.