jdf / processing-py-site

Site for processing.py.
MIT License
197 stars 52 forks source link

Index starts from 1 not 0 for this example of slice #218

Open gettingwings opened 1 year ago

gettingwings commented 1 year ago

Use a colon inside the index brackets to get a "slice" of the list, returned as a list. element_slice = elements[1:5] # from index 0 up to (not including) index 5 print(element_slice) # Prints ['He', 'Li', 'B', 'C']

-------------corrected below ----------------

from index 1 up to (not including) index 5

Index starts from 1 not 0 for this example of slice