learn python the hard way exercise 42 help

R

Raymond Hettinger

http://pastie.org/1735028
hey guys play is confusing me, i get how next gets the first room, which
is passed when the instance of Game() is created, but how does it get
the next room?

It might help show calling patterns if you added print statements to
the while loop:

def play(self):
next = self.start
while True:
room = getattr(self, next)
print "--- Calling the method:", room, "---"
next = room()
print "--- That method returned:", next, "---"

Raymond
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top