What does `list(range(5))` produce?

Python Developer Easy

Python Developer — Easy

What does `list(range(5))` produce?

Key points

  • The `range()` function generates a sequence of numbers.
  • The `list()` function converts this sequence into a list.
  • The range starts at 0 by default.
  • The upper limit specified in `range()` is not included in the output list.

Ready to go further?

Related questions