Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Range Data Type:

Vinay Rawal answered on April 1, 2023 Popularity 6/10 Helpfulness 1/10

Contents


More Related Answers

  • range in decimals html
  • input type range show range value
  • dataannotations datetime range
  • range function
  • range type in html
  • is out of range for type integer
  • Using range()#
  • The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
  • the range data annotation attribute (Double)
  • date range
  • the range() function

  • Range Data Type:

    0

    range Data Type represents a sequence of numbers.  The elements present in range Data type are not modifiable. i.e range Data type is immutable.

    Form-1: range(10) generate numbers from 0 to 9

    Eg: r = range(10) for i in r : print(i)  0 to 9

    Form-2: range(10, 20) generate numbers from 10 to 19

    Eg: r = range(10,20) for i in r : print(i) 10 to 19

    27 https://www.youtube.com/durgasoftware

    Form-3: range(10, 20, 2) 2 means increment value

    Eg: r = range(10,20,2) for i in r : print(i)  10,12,14,16,18

    We can access elements present in the range Data Type by using index.

    Eg: r = range(10,20) r[0]  10 r[15]  IndexError: range object index out of range

    We cannot modify the values of range data type

    Eg: r[0] = 100 TypeError: 'range' object does not support item assignment

    We can create a list of values with range data type

    Eg: 1) >>> l = list(range(10)) 2) >>> l 3) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] 

    Popularity 6/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Tags: range whatever
    Link to this answer
    Share Copy Link
    Contributed on Apr 01 2023
    Vinay Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.