Arrays: Difference between revisions

Content added Content deleted
m (→‎{{header|Python}}: Python 2 -> Python 3; PEP 8; grammar)
m (→‎{{header|Python}}: Mention slicing. Poke page to see if SMW syncs.)
Line 6,785: Line 6,785:
# Print the exception.
# Print the exception.
print(e)
print(e)
</syntaxhighlight>

Slicing a list creates a new list.
<syntaxhighlight lang="python">
another_array = my_array[1:3]
</syntaxhighlight>
</syntaxhighlight>