[Tutor] Starting classes
Kent Johnson
kent37 at tds.net
Sat Sep 1 02:22:27 CEST 2007
Ara Kooser wrote:
> def look(here):
> "Look around the place you are in"
> print here.description
This is technicaly OK but conventionally the first argument to a method
is 'self'. Since you are learning it would be good to keep to the
convention.
> outside1 = Area("Outside")
> outside1.description = "You are standing outside with the town gate to
> your back"
> self.contents.append("dirt")
>
>
> look(bedroom)
Maybe you mean
bedroom.look()
or
outside1.look()
Kent
More information about the Tutor
mailing list