mirror of
https://github.com/kennethreitz/python-guide.git
synced 2026-06-05 23:00:18 +00:00
Added Note for xrange
Python 3 does not have xrange(). Uses range() instead.
This commit is contained in:
@@ -349,7 +349,9 @@ Instead, use a list comprehension:
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
four_lists = [[] for __ in range(4)]
|
four_lists = [[] for __ in xrange(4)]
|
||||||
|
|
||||||
|
Note: Use range() instead of xrange() in Python 3
|
||||||
|
|
||||||
Create a string from a list
|
Create a string from a list
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|||||||
Reference in New Issue
Block a user