Anyone who uses python knows that the range () function is very convenient. when I use it again today, I find many details that I have previously seen but forgotten. Here we record range (), review the slide of the list, and finally analyze a bubble program of the cursor. Here we record: & amp; gt; range () # represents from 1 to 5 (not including 5, 3, 4] & amp; gt; range (1, 5, 2) # represents from 1... anyone who uses python knows that the range () function is very convenient. when I use it again today, I find many details that I have previously seen but forgotten. Here we record range (), review the slide of the list, and finally analyze a bubble program of the cursor.
Record here:
>>> Range (1, 5) # represents from 1 to 5 (not including 5)
[1, 2, 3, 4]
>>> Range (1, 5, 2) # represents from 1 to 5, interval 2 (not including 5)
[1, 3]
>>> Range (5) # represents from 0 to 5 (not including 5)
[0, 1, 2, 3, 4]