Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Take a number from list within list' topicStudent Support Forum > General > "Take a number from list within list"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Bill Simpson
10/14/12 4:09pm

[[-1]] will select the last item in a list and two subscipts will extract an item from a nested list.

In[1]:= {4,34,5,{a,b,c}}[[-1,1]]

Out[1]= a

In[2]:= {4,34,5,{a,b,c}}[[-1,2]]

Out[2]= b

URL: ,

Subject (listing for 'Take a number from list within list')
Author Date Posted
Take a number from list within list 215 10/14/12 02:54am
Re: Take a number from list within list Bill Simpson 10/14/12 4:09pm
Re: Take a number from list within list yehuda 10/15/12 02:46am
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic