Python variable range
Question: I'm trying to have a range that I can change on the fly. What I have found
here didn't help me to fix my error.

I am currently using a fixed variable to test what I am doing

I can not figure out how to post the actual code; I can't get it to paste. So
this is the general idea (I made this run; it fails with variables but works
with numbers).

I am using anaconda3 in Spyder (python 3.5).

    
    
    hi = 20
    hf = 0
    step = .1
    H = np.arange(hi, hf, step) ####range(start,end,step)
    U = []
    for l in H:
        U.append(l)
    
    print(U)
    >>> []     
    

I tried using `float` and `int` both when defining the variables (in every
way) and inside the `range()`. I tried a few other things as well. But the
only way I can get anything but an empty `[]` being printed is by using
numbers (any type of number works).


Answer: Running exactly this code:

    
    
    import numpy
    U=[]
    H=numpy.arange(0, 20, 0.1)
    for l in H:
        U.append(l)
    print(U)
    

works exactly as you'd expect. The problem is that you're trying to run with
bounds switched around - with your constants the call is actually `arange(20,
0, 0.1)`

