How do you create a list of n integers in Python?
Using Python range()
Python comes with a direct function range() which creates a sequence of numbers from start to stop values and print each item in the sequence. We use range() with r1 and r2 and then convert the sequence into list.
What does list [:] Do Python?
The list() function creates a list object. A list object is a collection which is ordered and changeable. Read more about list in the chapter: Python Lists.