def firstn num nums while num nums append num num return nums

1
2
3
4
5
6
def firstn(n):
num, nums = 0, []
while num < n:
nums.append(num)
num += 1
return nums