hello, was wondering how to sort a list which has different data types according to the data type,
Example if a list containing 'person' objects.
a person object wil have a name, gender and age like so:

person1 = person(name, gender, age)

so if i have 5 objects in a list and i wanna sort them first by name, then later by age, how do i go about that?

See the Student class under "Key Functions" here http://wiki.python.org/moin/HowTo/Sorting if you are talking about a list of classes. Also, see the "The Old Way Using the cmp Parameter" on the same page.

Thanks all....used the cmp method :P