{
  "id": "enwiki-001377539724",
  "slug": "range-computer-programming",
  "title": "Range (computer programming)",
  "qid": "",
  "lead": "In computer science, the term range may refer to one of three things: # The possible values that may be stored in a variable. # The upper and lower bounds of an array. # An alternative to iterator.",
  "body": "In computer science, the term range may refer to one of three things: The possible values that may be stored in a variable. The upper and lower bounds of an array. An alternative to iterator. public record Range (T Start, T End) where T : IComparable; Example in Kotlin. data class Range >(val start: T, val end: T) Example in PHP. readonly class Range { public function __construct( public T $start, public T $end, ) {} } Example in Python. from dataclasses import dataclass @dataclass class Range[T]: start: T end: T Rust has a built-in range struct in the standard library in . C++ has a library as well since C++20. let heartwarming = \"heartwarming!\".to_string(); let warm = &heartwarming[5..9]; Zig also has the operator. // To iterate over consecutive integers, use the range syntax. var sum: usize = 0; for (0..5) |i| { sum += i; } As does C#, string[] items = [\"one\",\"two\",\"three\",\"four\"]; string[] firstThreeItems = items[0..2]; F#, [1..4] // Outputs: [1; 2; 3; 4] Kotlin, for (i in 1..5) print(i) and Perl. for( 1..5) { print } Python and PHP does not have any range operator but they do have a function.",
  "categories": [
    "109366245",
    "20589555",
    "22954105",
    "23468805",
    "23603337",
    "24043274",
    "25257581",
    "26220375",
    "28043570",
    "39691156",
    "57958211",
    "60231876"
  ],
  "license": "CC BY-SA 4.0",
  "source_uri": "https://en.wikipedia.org/w/index.php?oldid=1377539724",
  "content_hash": "",
  "created_at": null,
  "updated_at": 1790715491.0,
  "claims": [],
  "contradictions": [],
  "confidence": 0.6,
  "csl": {
    "id": "enwiki-001377539724",
    "type": "webpage",
    "title": "Range (computer programming)",
    "author": [
      {
        "family": "Anticloud FZ LLE",
        "literal": "Anticloud FZ LLE"
      }
    ],
    "container-title": "encyclopegia.org",
    "publisher": "Anticloud FZ LLE",
    "publisher-place": "Dubai, United Arab Emirates",
    "URL": "https://encyclopegia.org/a/range-computer-programming",
    "issued": {
      "date-parts": [
        [
          2026,
          11,
          13
        ]
      ]
    },
    "accessed": {
      "date-parts": [
        [
          2026,
          11,
          13
        ]
      ]
    },
    "license": "CC BY-SA 4.0",
    "DOI": "eo1:enwiki-001377539724",
    "isBasedOn": "https://en.wikipedia.org/w/index.php?oldid=1377539724",
    "note": "Immutable snapshot enwiki-001377539724"
  }
}