range()
range() is a Python function in the Built-in Functions category. Returns an immutable sequence of numbers. Commonly used in for loops. The syntax is range(stop) / range(start, stop, step=1). Parameters: start (optional) — starting value (default 0). Returns: Range object. A typical example: list(range(5)) # [0, 1, 2, 3, 4]
list(range(2, 7, 2)) # [2, 4, 6]. A close sibling is print(), which prints objects to the text stream, separated by `sep` and followed by `end`. A close sibling is len(), which returns the length (number of items) of an object. Works with sequences, collections, and strings. A close sibling is type(), which returns the type of an object, or creates a new type with three arguments. A close sibling is int(), which converts a number or string to an integer, or returns 0 if no arguments. More about this category: Python's built-in functions available without importing — print, len, range, map, and more.