r/learnpython • • Aug 27 '18

Create an empty list

Good monday everyone!

I just started university and is learning python. I have no experience with the language whatsoever so i was hoping on getting some help here :)
We got an assignment to get used to some of the basic functions. The task is:

Create a program which starts with an empty list and ends up with a list

containing the numbers 1-10.000. This should not be done manually like

mylist=[1,2,...,10.000]. Hint use a for-loop and append.

Been stuck at this for hours now.

appreciate all answers :)

0 Upvotes

11 comments sorted by

View all comments

2

u/sheep1996 Aug 27 '18

Try googling "python populate list". You'll see how basic loops work in answers there.

1

u/sillycups Aug 27 '18

Thanks! At least now I know what I have to google :)