We can convert the output of range() Function to a list using ‘list()’ function.
Example
list(range(1, 10))
>>> list1 = list(range(1, 10))
>>>
>>> list1
[1, 2, 3, 4, 5, 6, 7, 8, 9]
This post first appeared on Java Tutorial : Blog To Learn Java Programming, please read the originial post: here