TOPIC 6: Python range ( )

2. Calling range() with Two Arguments

When two arguments are provided:

  • The first argument is the start value.

  • The second argument is the stop value.

Example:

x = range(3, 10)

print(list(x))

Output:

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

The sequence starts at 3 and stops before 10.