[Tutor] Do tuples replace structures?

Alan Gauld alan.gauld at blueyonder.co.uk
Mon Jan 12 18:57:10 EST 2004


> Do tuples allow one to form data structures like those formed by
structures
> in 'c' or are there better ways to form structures in python?

Quick n dirty structures yes, but for general use a class is
usually a better bet. Take a look at the last page of the Raw
Materials
topic in my tutor for an example of using a class to hold an "address"
structure (in the yellow box)

Alan G
Author of the Learn to Program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld




More information about the Tutor mailing list