Skip to content

Commit 4aa1cee

Browse files
committed
extra credit - added docstrings to functions
1 parent 7c331ab commit 4aa1cee

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ex35.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
from sys import exit
22

33
def gold_room():
4+
"""Describe gold room and take user input."""
45
print "This room is full of gold. How much do you take?"
56

67
next = raw_input("> ")
8+
79
if "0" in next or "1" in next:
810
how_much = int(next)
911
else:
@@ -17,6 +19,7 @@ def gold_room():
1719

1820

1921
def bear_room():
22+
"""Describe bear room and take user input."""
2023
print "There is a bear here."
2124
print "The bear has a bunch of honey."
2225
print "The fat bear is in front of another door."
@@ -39,6 +42,7 @@ def bear_room():
3942
print "I got no idea what that means."
4043

4144
def cthulu_room():
45+
"""Describe Cthulu room and take user input."""
4246
print "Here you see the great evil Cthulu."
4347
print "He, it, whatever stares at you and you go insane."
4448
print "Do you flee for your life or eat your head?"
@@ -54,10 +58,12 @@ def cthulu_room():
5458

5559

5660
def dead(why):
61+
"""Print out death message and exit the program."""
5762
print why, "Good job!"
5863
exit(0)
5964

6065
def start():
66+
"""Describe game start and take user input."""
6167
print "You are in a dark room."
6268
print "There is a door to your right and left."
6369
print "Which one do you take?"

0 commit comments

Comments
 (0)