Re: Position of Last Element in List
- To: mathgroup at smc.vnet.net
- Subject: [mg94245] Re: Position of Last Element in List
- From: SigmundV <sigmundv at gmail.com>
- Date: Tue, 9 Dec 2008 06:55:59 -0500 (EST)
- References: <ghb02f$oho$1@smc.vnet.net> <ghb5dv$rmb$1@smc.vnet.net>
Yes, now I see. If you had a list containing e.g. {4,1,6,5,8,7,1,4,1}, then you would like to know, what the position of the last 1 (among the three 1's) was. /Sigmund On Dec 8, 12:21 pm, Raffy <ra... at mac.com> wrote: > On Dec 6, 3:13 am, SigmundV <sigmu... at gmail.com> wrote: > > > Hello Raffy, > > > Excuse me, but I do not see what you want and what you would use it > > for. The sentence "the last position of an > > element at level 1 in a list" sounds a bit cryptic to me. Say that we > > have the list {{1, 2, 4, 6, -1}, {4, 10, 8, -2, 10}}, which is a list > > of lists. Here level 1 consists of the two lists {1, 2, 4, 6, -1} and > > {4, 10, 8, -2, 10}, right? How should "the last position of an > > element" be understood here? > > > Regards, > > Sigmund > > The elements at level 1 would be: {1, 2, 4, 6, -1} and {4, 10, 8, -2, = 10} > > If you asked for the last position of 2? It would return $Failed (or > something equiv). > If you asked for the last position of {1, 2, 4, 6, -1} ? It would > return 1.