Python List with range()

  • Post category:List

The range() function returns a sequence of numbers, starting from 0 by default, increments by 1 (by default), and ends at a specified number.

In this blog post, you will learn how to use the python list with range() function.

Step 1: Create a list using range()

my_list = list(range(3, 9))

Step 2: Print the list

print(my_list)

Output:

[3, 4, 5, 6, 7, 8]