Introduction to Python. Part 10. List generators
Introduction to Python. Part 10. List generators How to reduce your code to one line In the lesson before last, we learned how to work with lists in Python. Now let's explore how we can create lists in a faster and more syntactically beautiful way. Filming, editing: Gleb Limansky To solve one practical problem, we need to create a list with years from 2000 to 2019. We can do it like this: Remember that according to the rules of slices in Python, you need to add +1 to the last element.