Re: [Tutor] Starting classes

2007-08-31 Thread Kent Johnson
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"

Re: [Tutor] Starting classes

2007-08-31 Thread Alan Gauld
<[EMAIL PROTECTED]> wrote > def look(here): >"Look around the place you are in" >print here.description > > Not sure if this works as is, I believe it depends on the > interpreter, but > it is customary to use the word self as the first parameter, It is just a custom and 'here'

Re: [Tutor] Starting classes

2007-08-31 Thread Ricardo Aráoz
Eric Brunson wrote: > Ara Kooser wrote: >> Hello, >> I read Alan Gauld's and How to Think Like a Computer Scientist >> section on classes. So I tried to write a simple room class. My goal >> is to write a short text adventure using classes. Here is the code: >> >> class Area: >> def _init_(se

Re: [Tutor] Starting classes

2007-08-31 Thread Eric Brunson
Ara Kooser wrote: > Hello, > I read Alan Gauld's and How to Think Like a Computer Scientist > section on classes. So I tried to write a simple room class. My goal > is to write a short text adventure using classes. Here is the code: > > class Area: > def _init_(self, name, description): >