As a beginner in python, I was trying to test the function range() in the IDLE terminal. I wrote in the terminal the below posted code and I expected to see result like this:
range(10)==>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
But unfortunately, i do not get the expected result
Python Code I Tried:
range(10)
print(range(10))
The Result From The shell:
range(10)
range(10)to a variable in the first line. The second lineprint(range(10))should work.range(11)?range(1, 11)?rangeis now whatxrangewas in python2. To obtain alistof numbers uselist(range(...)).