This question already has an answer here:
- Python 3 turn range to a list 8 answers
Having a beginner issue with Python range.
I am trying to generate a list, but when I enter:
def RangeTest(n):
#
list = range(n)
return list
print(RangeTest(4))
what is printing is range(0,4)
rather than [0,1,2,3]
What am I missing?
Thanks in advance!