Using the third step argument
suggest changelst = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
lst[::2]
# Output: ['a', 'c', 'e', 'g']
lst[::3]
# Output: ['a', 'd', 'g']
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents