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
A range of ten numbers that starts from 20 is created and displayed by using the for loop as shown below The 1 means to start at second element in the list note that the slicing index starts at 0 . The step is the difference The real part of the number is a and the imaginary part is b. When you execute new_List old_List you don t actually have two lists. randint 10 size 6 Iterating over a one dimensional numpy array is very similar to iterating over a list If you wanted to generate a sequence of random numbers one way to achieve that would be with a Python list comprehension gt gt gt random .
๐ŸŒ
Sudoloilandgas
sudoloilandgas.com โ€บ google-classroom โ€บ python-generate-list-of-numbers-with-step-size.html
Python generate list of numbers with step size
Python program that creates string lists Part A create a list of three strings. Numbers generated with this module are not truly random but they are enough random for most purposes. Find the third largest number in a list in python. Start 5 Stop 30 Step Size 2 arr np.
๐ŸŒ
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 ...
๐ŸŒ
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 - Not everyone is comfortable using the popular Python programming language, and not everyone wants to learn it. Especially for Windows users we offer to use a unique script (a usual .exe file), which allows you to create a list of pre-defined values. 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 - range(start, stop[, step])Code language: Python (python) It takes three arguments. Out of the three, two are optional. The start and step are optional arguments and the stop is the mandatory argument. start: (Lower limit) It is the starting ...
Find elsewhere
๐ŸŒ
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.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-create-list-of-numbers-with-given-range
Create List of Numbers with Given Range - Python - GeeksforGeeks
For example, if the range is from 0 to 10, the resulting list would contain the numbers 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. range() generates an iterator that produces numbers within a specified range. It is highly efficient as it doesnโ€™t create the entire list upfront, making it memory-friendly.
Published: July 11, 2025
๐ŸŒ
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.
๐ŸŒ
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โ€ฆ
๐ŸŒ
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.
๐ŸŒ
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,..,...
๐ŸŒ
Real Python
realpython.com โ€บ python-range
Python range(): Represent Numerical Ranges โ€“ Real Python
September 9, 2025 - The range() function can be used to generate sequences of numbers that can be converted to lists. for i in range(5) is a loop that iterates over the numbers from 0 to 4, inclusive.