Skip to content

Commit 7aca681

Browse files
committed
Added Note for xrange
Python 3 does not have xrange(). Uses range() instead.
1 parent e6fb422 commit 7aca681

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/writing/style.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,9 @@ Instead, use a list comprehension:
349349

350350
.. code-block:: python
351351
352-
four_lists = [[] for __ in range(4)]
352+
four_lists = [[] for __ in xrange(4)]
353+
354+
Note: Use range() instead of xrange() in Python 3
353355

354356
Create a string from a list
355357
~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)