Use range. In Python 2, it returns a list directly:

>>> range(11, 17)
[11, 12, 13, 14, 15, 16]

In Python 3, range is an iterator. To convert it to a list:

>>> list(range(11, 17))
[11, 12, 13, 14, 15, 16]

Note: The second number in range(start, stop) is exclusive. So, stop = 16+1 = 17.


To increment by steps of 0.5, consider using numpy's arange() and .tolist():

>>> import numpy as np
>>> np.arange(11, 17, 0.5).tolist()

[11.0, 11.5, 12.0, 12.5, 13.0, 13.5,
 14.0, 14.5, 15.0, 15.5, 16.0, 16.5]

See: How do I use a decimal step value for range()?

Answer from Jared on Stack Overflow
๐ŸŒ
Finxter
blog.finxter.com โ€บ home โ€บ learn python blog โ€บ python create list from 1 to n
Python Create List from 1 to N - Be on the Right Side of Change
April 20, 2024 - To generate a list of numbers with a specific step size, you can use the range() function with three arguments: start, stop, and step.
๐ŸŒ
Hobare
files.hobare.com โ€บ educational-leadership โ€บ python-generate-list-of-numbers-with-step-size.html
Python generate list of numbers with step size
Create a list of unique random float numbers. Return the number of bytes in the underlying data. To use them as integers you will need to convert the user input into an integer using the int function. Subscript operator. The default size of a step is 1 if not specified. ones Create a numpy array of zeros or ones 2 days ago This module implements pseudo random number generators for various distributions. The micro bit Python Apr 16 2020 Lists may contain objects of varying types.
๐ŸŒ
Finxter
blog.finxter.com โ€บ home โ€บ learn python blog โ€บ python create list from 1 to n with step size
Python Create List From 1 to N with Step Size - Be on the Right Side of Change
April 22, 2024 - Using [i for i in range(1, n+1, step)] is the most straightforward method using built-in Python functions: list comprehension and range(). list_with_step = [i for i in range(1, n + 1, step)] For those using the NumPy library, particularly effective ...
๐ŸŒ
Sudoloilandgas
sudoloilandgas.com โ€บ google-classroom โ€บ python-generate-list-of-numbers-with-step-size.html
Python generate list of numbers with step size
You cannot copy a list simply by typing list2 list1 because list2 will only be a reference to list1 and changes made in list1 will automatically also be made in list2. Let us see how we can create a 2D array in Python. Each number you generate restricts the possibilities for future numbers. size. Here start of Interval is 5 Stop is 30 and Step is 2 i.
๐ŸŒ
Photolessons
photolessons.org โ€บ home โ€บ python โ€บ generate list of numbers with step size โ€“ python (.exe)
Generate list of numbers with step size - PYTHON (.exe)
September 22, 2023 - The point is this: you specify the number of the beginning of the list, the number that ends the list, as well as the step with which these numbers will go.
๐ŸŒ
LabEx
labex.io โ€บ tutorials โ€บ python-how-to-generate-a-list-of-integers-between-two-values-in-python-395064
How to generate a list of integers between two values in Python | LabEx
You can also use list comprehension with a step size: numbers = [x for x in range(1, 11, 2)] print(numbers) ## Output: [1, 3, 5, 7, 9] If you're working with the NumPy library, you can use the numpy.arange() function to generate a list of integers.
๐ŸŒ
PYnative
pynative.com โ€บ home โ€บ python โ€บ python range() explained with examples
Python range() Function Explained with Examples
March 17, 2022 - Python range() returns the sequence of numbers starting from a given start integer to a stop integer, which we can iterate using a for loop
Find elsewhere
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-create-list-of-numbers-with-given-range
Create List of Numbers with Given Range - Python - GeeksforGeeks
Each number in this range is added to the list li. numpy.arange() from the NumPy library that generates an array of evenly spaced values over a specified range.
Published: July 11, 2025
๐ŸŒ
Delft Stack
delftstack.com โ€บ "delft stack" โ€บ "howto" โ€บ "python how-to's" โ€บ "how to list of numbers from 1 to n in python"
How to List of Numbers From 1 to N in Python | Delft Stack
February 12, 2024 - Here, np.arange(2, 11, 2) generates an array of even numbers starting from 2, stopping before 11, and with a step size of 2.
๐ŸŒ
ItSolutionstuff
itsolutionstuff.com โ€บ post โ€บ how-to-create-a-list-of-numbers-from-1-to-n-in-pythonexample.html
How to Create a List of Numbers from 1 to N in Python? - ItSolutionstuff.com
October 30, 2023 - You can use these examples with python3 (Python 3) version. ... [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50] ... import numpy as np # python create list of numbers from 1 to n n = 51 myList = np.arange(1, n, 0.5).tolist() print(myList)
๐ŸŒ
GitConnected
levelup.gitconnected.com โ€บ the-fastest-way-to-generate-a-sequence-in-python-a61da7f87852
The fastest way to generate a sequence in Python | by Astronomy not Astrology, hunty... | Level Up Coding
May 14, 2020 - The range() method generates an immutable object that is a sequence of numbers. The range() object can easily be converted into a Python list by enclosing it in the list method, for example, creating a list of values between 10 (start) and 0 (stop) decreasing inโ€ฆ
๐ŸŒ
H2K Infosys
h2kinfosys.com โ€บ home โ€บ python tutorials โ€บ mastering range of numbers in array with numpy: arange & linspace simplified
Mastering Range of Numbers in Array with Numpy: arange & linspace Simplified | H2K Infosys Blog
March 22, 2021 - This basic usage generates an array of integers from 0 to 9. python import numpy as np array = np.arange(10) print(array) ... This array contains 10 integers starting from 0 up to (but not including) 10, with a default step size of 1.
๐ŸŒ
Enterprise DNA
blog.enterprisedna.co โ€บ how-to-make-a-list-from-1-to-100-in-python-7-top-ways-code
Enterprise DNA: We Help Businesses Put Data and AI to Work
Learn data and AI skills on the platform, bring us in on a project, or run a managed Omni Command Centre. 220K+ professionals trained, 1,500+ companies impacted globally.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python-decimal-step-range-in-list
Python | Decimal step range in list - GeeksforGeeks
April 13, 2023 - Then it uses the itertools.islice() function to take the first "length" number of elements from that sequence and convert it into a list. The resulting list will be a list of decimal numbers with a specific step.
๐ŸŒ
W3docs
w3docs.com โ€บ python
How do I create a list with numbers between two values? | W3Docs
Create a list of numbers between two values in Python using list comprehension ... You can also generate a list of numbers with a specific step between each number using range function
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ article โ€บ create-list-of-numbers-with-given-range-in-python
Create list of numbers with given range in Python
Use range() for creating lists of sequential numbers, random.randrange() for selecting random values from a range, and np.arange() for numerical operations requiring NumPy arrays.
๐ŸŒ
Python Examples
pythonexamples.org โ€บ python-create-a-list-of-numbers-from-1-to-n
Create a List of Numbers from 1 to n in Python
# Take n value n = 12 # Generate list from 1 to n using list comprehension output = [i for i in range(1, n+1)] # Print the list print(output) ... In this tutorial of Python Examples, we learned how to create a list of numbers from 1 to n, with the help of well detailed examples.
๐ŸŒ
NumPy
numpy.org โ€บ doc โ€บ stable โ€บ reference โ€บ generated โ€บ numpy.arange.html
numpy.arange โ€” NumPy v2.5 Manual
arange(start, stop, step) Values are generated within the half-open interval [start, stop), with spacing between values given by step. For integer arguments the function is roughly equivalent to the Python built-in range, but returns an ndarray rather than a range instance.
๐ŸŒ
Python Forum
python-forum.io โ€บ thread-16682.html
How to create meshgrid with non-integer stepsize of list elements?
March 10, 2019 - I have 2 lists of x and y coordinate that are independently generated, with a/h amount of points between 0 and a. x = np.linspace(0, a, a/h) y = np.linspace(0, d, d/h)when a/h is such that 0 increases to a in steps of integers i.e. [0,1,2,..,...