GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.geeksforgeeks.org — Python range() function - GeeksforGeeks Python range() functionLast Updated : 10 Mar, 2026 The range() function in Python is used to generate a sequence of integers within a specified range. It is most commonly used in loops to control how many times a block of code runs.
Example: This example shows the use of range() to generate numbers starting from 0 up to (but not including) a given value.
Output 0 1 2 3 4 Explanation:
Syntax
Parameters:
Return: A range object representing the sequence ExamplesExample 1: This example generates numbers starting from a custom value and ending before another value.
Output 5 6 7 8 9 Explanation:
Example 2: This example generates even numbers by skipping values using a custom step size.
Output 0 2 4 6 8 Explanation:
Example 3: This example demonstrates how range() can be used to generate numbers in reverse order by providing a negative step value.
Output 10 8 6 4 2 Explanation:
Comment Explore |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |