how to fill an array with consecutive numbers python

Solutions on MaxInterview for how to fill an array with consecutive numbers python by the best coders in the world

showing results for - "how to fill an array with consecutive numbers python"
Betty
07 May 2017
1array = [x for x in range(0, 10)]
2
3print(array)
4
5#OUTPUT: [0, 1, 2, 3, 4, 5 6, 7, 8, 9]