I recommend that you work through a tutorial on for loops -- the information you need is there, as well as other hints on using controlled iteration. To solve your immediate need, simply increase your upper bound by one loop increment:

inc = 2*np.pi/360
theta = np.arange(0, angle/2 + inc, inc)
Answer from Prune on Stack Overflow
🌐
Statology
statology.org › home › numpy: how to use arange and include endpoint
NumPy: How to Use arange and Include Endpoint
March 20, 2023 - This tutorial explains how to use the NumPy arange function and include the endpoint as a value in the array, including examples.
🌐
Python Pool
pythonpool.com › home › blog › the numpy arange function and including endpoints
The Numpy arange Function and Including Endpoints - Python Pool
July 20, 2022 - Increase the upper bound limit by 1 value. Initially, np.arange() does not include the endpoint. By increasing your upper value, the endpoint is obtained.
🌐
Arab Psychology
scales.arabpsychology.com › home › how to include the endpoint in your numpy arange sequence
How To Include The Endpoint In Your Numpy Arange Sequence
November 20, 2025 - We effectively tell arange to generate values up to 55 (exclusive), which guarantees that 50 is included in the iteration process: import numpy as np #specify start, stop, and step size start = 0 stop = 50 step = 5 #create array, ensuring endpoint inclusion np.arange(start, stop + step, step) array([ 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50])
🌐
datagy
datagy.io › home › numpy › numpy arange(): complete guide (w/ examples)
NumPy arange(): Complete Guide (w/ Examples) • datagy
December 30, 2022 - By default, the NumPy arange() function will start at 0 and continue up to the specified stop value (though not include it). You can modify the starting value of the resulting array by passing a value into the start= parameter.
🌐
NumPy
numpy.org › doc › stable › user › how-to-partition.html
How to create arrays with regularly-spaced values — NumPy v2.4 Manual
>>> np.arange(0, 28)*0.04 array([0. ... similar to numpy.linspace, but with numbers spaced evenly on a log scale (a geometric progression). The endpoint is included in the result....
🌐
Stack Abuse
stackabuse.com › guide-to-numpys-arange-function
Guide to NumPy's arange() Function
May 8, 2023 - This is a simple example of np.linspace() with the endpoint included and 5 samples:
🌐
Nickmccullum
nickmccullum.com › how-to-use-numpy-arange
np.arange() - How To Use the NumPy arange() Method | Nick McCullum
April 25, 2020 - To be specific, the np.arange() method includes the lower endpoint but excludes the lower endpoint.
Find elsewhere
🌐
Note.nkmk.me
note.nkmk.me › home › python › numpy
NumPy: arange() and linspace() to generate evenly spaced values | note.nkmk.me
February 2, 2024 - How to use np.arange() How to use np.linspace() Basic usage · Specify whether to include stop: endpoint · Get the interval: retstep · Convert to reverse order · Convert to multi-dimensional arrays · The NumPy version used in this article is as follows. Note that functionality may vary between versions.
🌐
GitHub
github.com › numpy › numpy › issues › 11913
numpy arange includes right hand side · Issue #11913 · numpy/numpy
September 8, 2018 - Not sure if this is a bug or not but i seem to be able to generate an array using np.arange that includes the right hand side... Reproducing code example: import numpy as np np.arange(1,1.5,.1) # a...
Author   rshap91
🌐
Stack Overflow
stackoverflow.com › questions › 79577927 › apparently-weird-condition-on-inclusion-of-endpoint-in-np-arange
python - Apparently weird condition on inclusion of endpoint in np.arange() - Stack Overflow
The interval does not include this value, except in some cases where step is not an integer and floating point round-off affects the length of out." ... @Homer512, I am so regretful of not scolling down more on the documentation page of np.arange (yes, I had checked it when I was scratching my head, just overlooked it).
🌐
NumPy
numpy.org › doc › 2.1 › user › how-to-partition.html
How to create arrays with regularly-spaced values — NumPy v2.1 Manual
>>> np.arange(0, 28)*0.04 array([0. ... similar to numpy.linspace, but with numbers spaced evenly on a log scale (a geometric progression). The endpoint is included in the result....
🌐
Arab Psychology
scales.arabpsychology.com › home › stats › how can i use numpy’s arange function to create an array that includes the endpoint?
How Can I Use NumPy's Arange Function To Create An Array That Includes The Endpoint?
June 24, 2024 - It allows you to specify the start, stop, and step size of the array. By default, the endpoint is not included in the array. However, if you want to include the endpoint, you can simply add 1 to the stop value.
🌐
Real Python
realpython.com › how-to-use-numpy-arange
NumPy arange(): How to Use np.arange() – Real Python
July 31, 2023 - linspace() is similar to arange() in that it returns evenly spaced numbers. But you can specify the number of values to generate as well as whether to include the endpoint and whether to create multiple arrays at once.
🌐
H2K Infosys
h2kinfosys.com › blog › mastering range of numbers in array with numpy: arange & linspace simplified
Mastering Range of Numbers in Array with Numpy: arange & linspace Simplified
October 31, 2025 - Inclusivity: By default, both endpoints are included, but you can exclude the endpoint if needed. import numpy as np # Generate 10 evenly spaced numbers between 1 and 10 numbers = np.linspace(1, 10, 10) print(numbers) ...
🌐
SciPy
docs.scipy.org › doc › numpy-1.6.0 › reference › generated › numpy.arange.html
numpy.arange — NumPy v1.6 Manual (DRAFT)
May 15, 2011 - Values are generated within the ... interval including start but excluding stop). For integer arguments the function is equivalent to the Python built-in range function, but returns a ndarray rather than a list. When using a non-integer step, such as 0.1, the results will often not be consistent. It is better to use linspace for these cases. ... Evenly spaced numbers with careful handling of endpoints. ... >>> np.arange(3) array([0, ...
🌐
NumPy
numpy.org › doc › 2.2 › user › how-to-partition.html
How to create arrays with regularly-spaced values — NumPy v2.2 Manual
>>> np.arange(0, 28)*0.04 array([0. ... similar to numpy.linspace, but with numbers spaced evenly on a log scale (a geometric progression). The endpoint is included in the result....
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.arange.html
numpy.arange — NumPy v2.4 Manual
>>> power = 40 >>> modulo = 10000 >>> x1 = [(n ** power) % modulo for n in range(8)] >>> x2 = [(n ** power) % modulo for n in np.arange(8)] >>> print(x1) [0, 1, 7776, 8801, 6176, 625, 6576, 4001] # correct >>> print(x2) [0, 1, 7776, 7185, 0, 5969, 4816, 3361] # incorrect ... Evenly spaced numbers with careful handling of endpoints.
🌐
SciPy
docs.scipy.org › doc › numpy-1.3.x › reference › generated › numpy.arange.html
numpy.arange — NumPy v1.3 Manual (DRAFT)
March 20, 2009 - Values are generated within the ... interval including start but excluding stop). For integer arguments the function is equivalent to the Python built-in range function, but returns a ndarray rather than a list. ... Evenly spaced numbers with careful handling of endpoints. ... >>> np.arange(3) array([0, ...