[Tutor] Circular approach to a dictionary structure

Alan Gauld alan.gauld at freenet.co.uk
Fri Oct 28 23:48:59 CEST 2005


I don;t know if theres a better way but

> next_phases = {"open":"review","review":"write","write":"open"}
> Note that the value for each of the first keys is the key for
> the next item, and that the value for the last key is the *first* key.

But I think this is pretty neat, I like it. Now I just need to find a 
problem that I can use it on :-)

Alan G.

More information about the Tutor mailing list