> Hi All, > > Could someone show me how to do this? > > I want to generate a list using a Markov chain, however, as well as > using the previous two items in the list to decide the current choice I > want the decision to be also dependant on an item at the current > position in another list. > > I hope this explains thing clearly enough. > > Thanks, > > Malcolm
What's wrong with keeping explicitly the index of the current position, say j ? Then you can index the previous two items as chain[j-1], chain[j-2] and the item in the other list as otherchain[j]. If you're talking about something else, you need to clarify the problem more. George -- http://mail.python.org/mailman/listinfo/python-list