Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Safely take elements from lists
ResourceFunction["SafeTake"][list,n] gives the first n of list (as if using UpTo). | |
ResourceFunction["SafeTake"][list,-n] safely take the last n of list. | |
ResourceFunction["SafeTake"][list,{n,m}] safely take elements n though m of list. |
Give all the elements, up to 10:
In[1]:= |
Out[1]= |
Give the elements from position 3 to 7:
In[2]:= |
Out[2]= |
Take the last 100 elements:
In[3]:= |
Out[3]= |
This work is licensed under a Creative Commons Attribution 4.0 International License