DEV Community

loading...

My Favorite Python Feature: List Comprehensions

renegadecoder94 profile image Jeremy Grifski Updated on ・1 min read

As someone playing around in the YouTube space, I decided to make a video which explains the following code snippet:

[item for item in range(1, 101)]

If you're not sure what you're looking at, that's fine! In short, it's a list comprehension that generates a list containing all integers from 1 to 100 (excluding 101). If you'd like to learn more about this syntax, check out the following video:

Alternatively, you're welcome to check out the article which inspired the video. In either case, thanks for checking out my work!

Discussion

pic
Editor guide