Range
A language or API construct that represents or generates an ordered sequence or interval of values, with its bounds and any step interpreted according to that language or API.
A Pythonic Adventure: From Python basics to a working web app
The Python range function produces an arithmetic sequence of integers represented by a range object.
- How it is used
- Builds dynamic menu choices from a list length during input validation.
- How deep it goes
- Explains loop construction and the exclusive upper boundary, stopping short of deeper range-object internals.
- Examples
- Uses drink and flavor menus to generate numeric answer strings for lists of different lengths.
- What you can do after
- Build dynamic numeric choices for a menu by combining range() with len(), a for loop, and append().
Read how A Pythonic Adventure: From Python basics to a working web app explains range →
Tiny Python Projects: Learn coding and testing with puzzles and games
range() is a Python built-in that represents an arithmetic sequence of integers for iteration.
- How it is used
- Uses integer sequences to control loops, generate indexes, and assemble repeated verses or output.
- How deep it goes
- Explains arguments, exclusive bounds, lazy evaluation, throwaway variables, indexing, and reverse steps, but defers implementation internals.
- Examples
- Demonstrates repeated insults, character-index sampling, bottle-song countdowns, Christmas-day counting, and squared-number list comprehensions.
- What you can do after
- Apply it via Python loops, comprehensions, map(), indexing, and reverse counting with correctly chosen bounds and steps.
Read how Tiny Python Projects: Learn coding and testing with puzzles and games explains range →
Learn AI-Assisted Python Programming, Second Edition
The Python range function produces an integer sequence whose upper bound is exclusive.
- How it is used
- Controls repeated actions and supplies valid indices for lists or strings.
- How deep it goes
- Defines the exclusive upper bound and demonstrates list conversion, len, indexing, and for-loop use.
- Examples
- Uses range(0, 9), list(range(3, 9)), and an indexed loop over cat, dog, bird, and fish.
- What you can do after
- Apply it via Python to generate bounded integer sequences and iterate through collection indices.
Read how Learn AI-Assisted Python Programming, Second Edition explains range →
The Well-Grounded Rubyist, Fourth Edition
Range is Ruby's built-in object representing a sequence bounded by beginning and ending values, or by a beginning value alone for an endless range.
- How it is used
- Uses ranges chiefly as inclusion tests, while also treating suitable ranges as collections and selection criteria.
- How deep it goes
- Works through construction, endpoint inspection, contrasting inclusion tests, and enumeration limits; leaves fuller enumeration treatment to Enumerable.
- Examples
- Contrasts string-range membership tests, integer and float enumeration, collection slices, and range-based grep results.
- What you can do after
- Apply it via Ruby range literals and inclusion methods to test values, slice collections, and select with Enumerable#grep.
Read how The Well-Grounded Rubyist, Fourth Edition explains range →
Get Programming: Learn to code with Python
A range expression is a Python expression that produces an arithmetic progression of integers, typically starting at zero and ending before a specified endpoint.
- How it is used
- Controls integer sequences and repetition counts inside for loops.
- How deep it goes
- Explains one-, two-, and three-argument forms, exclusive endpoints, steps, descending ranges, and loop execution.
- Examples
- Uses range(3), unrolled assignments, countdowns, even-number checks, and repeated messages.
- What you can do after
- Apply it via Python for loops to repeat statements and generate customized integer sequences.
Read how Get Programming: Learn to code with Python explains range →
Clojure: The Essential Reference
range is a Clojure function that generates a numeric sequence from a start value toward an end value using a specified step.
- How it is used
- Generates numeric inputs for sequence-processing operations and indexed algorithms.
- How deep it goes
- Defines arities, defaults, stopping rules, direction, numeric precision, and invalid-arity behavior through examples.
- Examples
- Demonstrates integer, even, descending, fractional, nested, palindrome-index, and large-number ranges.
- What you can do after
- Apply it via Clojure to construct bounded, unbounded, ascending, descending, and fractional numeric sequences.
Learn Haskell by Example
Range syntax is Haskell list notation that denotes enumeration of values between specified bounds or from a starting value.
- How it is used
- Generates lists of consecutive or stepped values for alphabets, digits, numeric sequences, and enumeration-type constructors.
- How deep it goes
- Defines bounded and open-ended notation, stepped ranges, and its expansion into Enum functions without detailing evaluation internals.
- Examples
- Builds alphabets, digit collections, numeric sequences, and complete lists of custom FileType constructors.
- What you can do after
- Apply range notation to construct bounded, stepped, open-ended, and custom enumeration lists.
Spring in Action, Sixth Edition
range is a Project Reactor factory operation that creates a Flux emitting a finite sequence of consecutive integers.
- How it is used
- Creates finite counter-style Flux data for reactive pipelines and tests.
- How deep it goes
- Explains parameters, emitted values, completion, and test verification, but does not discuss implementation internals.
- Examples
- Uses Flux.range(1, 5) and verifies the integers 1 through 5 before completion.
- What you can do after
- Apply it via Project Reactor to create and verify a finite integer-emitting Flux.
Related concepts
- lazy listproduces · A lazy list is an immutable sequence whose elements and continuation are computed incrementally on demand, allowing finite or infinite sequences.
- loopuses · A loop is a programming control-flow construct that repeatedly executes a block of instructions according to an iteration rule or continuation condition.
- token idproduces · A token ID is a numeric identifier assigned to a token in a vocabulary so it can be represented and processed numerically.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.







