There are so many ways we can return a list from a python function. One such function is given below.
Example
def retList(): list = [] for i in range(0,10): list.append(i) return list a = retList() print a
Output
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
There are so many ways we can return a list from a python function. One such function is given below.
def retList(): list = [] for i in range(0,10): list.append(i) return list a = retList() print a
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]