Suggested small change to code (#5509)
In a code example I think it best to either use full names (index, item) or abbreviated names where that's common (i, item) but not non-standard abbreviations (indx, itm). So I've changed it to index, item since it is a tutorial, although i, item would be just as good.
This commit is contained in:
parent
1be0022e7c
commit
3ab884a9e3
1 changed files with 2 additions and 2 deletions
|
|
@ -411,8 +411,8 @@ Other useful iterators for collections (like arrays and sequences) are
|
||||||
* ``pairs`` and ``mpairs`` which provides the element and an index number (immutable and mutable respectively)
|
* ``pairs`` and ``mpairs`` which provides the element and an index number (immutable and mutable respectively)
|
||||||
|
|
||||||
.. code-block:: nim
|
.. code-block:: nim
|
||||||
for indx, itm in ["a","b"].pairs:
|
for index, item in ["a","b"].pairs:
|
||||||
echo itm, " at index ", indx
|
echo item, " at index ", index
|
||||||
# => a at index 0
|
# => a at index 0
|
||||||
# => b at index 1
|
# => b at index 1
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue