whileLoops as long as the condition is true.Syntaxwhile condition ... endDescriptionUsed when the number of repetitions is not known in advance.ExampleLoading editor…▶ Try it yourselfExpected output0 1 2When to use?Indefinite repetition.Related commandstimes / upto / each← times / upto / each