Aug-24-2020, 09:42 AM
Thank you @deanhystad for reply!
My desired output is a list [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]. Of course, I know I can do it by
When I arrange my example to:
My desired output is a list [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]. Of course, I know I can do it by
list(range(0, 10)), but this is just an example of something more complicated.
When I arrange my example to:
def output(n): i = n for i in range(0, n-1): return i i +=1 arr = [] arr.append(output(10))I got an a list [0], which is obvious, because the loop ended after return. But how can I rearrange the output() function to be able to append its output to a list arr? Thanks again!