class Pit

We'll write our remaining classes from simplest to most complex. You'll recall that a pit has one attribute,Β location, and just one method,Β swallow. In Python:

In a modern graphic game aΒ Pit'sΒ swallowΒ method would trigger some fabulous animation of the player tumbling downward, but since this is text-based we have to settle for saying what is happening, and leaving the special effects to the user's imagination.