mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
range() doesn't return a list
This commit is contained in:
parent
b2b35af751
commit
3db5e7be1c
1 changed files with 1 additions and 1 deletions
|
@ -182,7 +182,7 @@ the next item assigned to it.
|
||||||
Names in the target list are not deleted when the loop is finished, but if the
|
Names in the target list are not deleted when the loop is finished, but if the
|
||||||
sequence is empty, it will not have been assigned to at all by the loop. Hint:
|
sequence is empty, it will not have been assigned to at all by the loop. Hint:
|
||||||
the built-in function :func:`range` returns an iterator of integers suitable to
|
the built-in function :func:`range` returns an iterator of integers suitable to
|
||||||
emulate the effect of Pascal's ``for i := a to b do``; e.g., ``range(3)``
|
emulate the effect of Pascal's ``for i := a to b do``; e.g., ``list(range(3))``
|
||||||
returns the list ``[0, 1, 2]``.
|
returns the list ``[0, 1, 2]``.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue