for id in ('A', 'B', 'C'): if segment.upper().startswith(id): Think dictionary:
objects = {'A': a, 'B':b, 'C':c} for id in ('A','B','C') objects[id].method() I have a section within my OOP topic that specifically talks about this in the context of a collection of bank account objects. You might find it worth skimming through. HTH, Alan G Author of the learn to program web tutor http://www.freenetpages.co.uk/hp/alan.gauld _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor