[Tutor] learning classes (kinda long)
Alan G
alan.gauld at freenet.co.uk
Sun Jul 31 10:26:12 CEST 2005
> first I would like for this instance to be named the name of the
> host in
> the section but i keep getting instances named section
This is a common beginners question but its nearly always the wrong
thing to do. For a start how would the rest of your program know about
these new instance names? Its much better to use a dictionary to store
the names as keys and the instances as values.
> implemeting it. Any pointers to good reading material is
> appreciated
> and will be read, but discussion of classes would benefit most who
> are
> interested....
The OOP topic in my tutor has an example of what you want using
bank accounts.
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