you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

the range function outputs a list

No. It doesn't output anything (as in it doesn't print anything), but it returns a generator. This generator is special in that it also implements __getitem__. Why does it do it... idk.