What if I have 1000 photos in the folder? Is that to big for a list?
Good that you’re thinking of these sorts of things, but if you’re new to programming (rather than just python) TBH I’d start with getting it working, then think about how to make it better.
That said, if you want the long answer…..
….1000 images? you’ll be fine. But for further reading:
https://docs.python.org/3/library/os.html is the relevant reference for file system ops.
You could use something like glob (https://docs.python.org/2/library/glob.html) to restrict to just images (consider a folder might have other files).
Or there’s os.walk() to get a generator you can just loop over, and not manage the list yourself, but that’s creating larger data structures and more file system queries in the large-no-of-files case (1000 isn’t large!) os.listdir() is better in this case, as it’s doing less per-file, generating smaller data structures as it goes.
Speaking of generating, it can get fiddly if you need generators, in which case also look at https://docs.python.org/3.4/library/pathlib.html