Embed presentation










The range() function in Python is used to generate sequences of numbers. It returns a sequence of integers from start to stop-1 by default or allowing for specification of the start, stop, and step values. Examples show using range() in for loops to print numbers from 0 to 5 with the default start of 0 and increment of 1, from 2 to 6 with a specified start of 2, and from 2 to 30 incrementing by 3. The document also provides examples of calculating a factorial using for and while loops with range().









