-2
numbers = []
for i in range(1,n+1):
    numbers.append(i)

print(*numbers, sep='')

While solving questions on hacker rank I came across this question an I don't really understand what is the meaning of *numbers in the line:

print(*numbers, sep='')

this is the image of the question

  • *numbers would expand the array into parameters, so if you have `numbers = [1,2,3]` then it would expand to `print(1, 2, 3, sep=' ')` – solarc Aug 14 '23 at 05:23

0 Answers0