Skip to content

Instantly share code, notes, and snippets.

@jramos70
Created October 22, 2018 03:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jramos70/1a71e58250f034fdbd4de0c806082ed4 to your computer and use it in GitHub Desktop.
Save jramos70/1a71e58250f034fdbd4de0c806082ed4 to your computer and use it in GitHub Desktop.
DLA Experiment - Week 6
class Spooktober:
def __init__(self):
self.date = "October 31"
self.isSpooky = True
self.num_ghosts = 0
self.jack_o_lantern_is_lit = False
def add_ghosts(self, num):
if self.isSpooky:
for i in range(num):
self.num_ghosts += 1
print(num, "spooky ghosts added")
print("There are now", self.num_ghosts, "spooky ghosts")
def scare(self):
if self.isSpooky:
for i in range(self.num_ghosts):
print ("BOO!")
def light_jack_o_lantern(self):
if self.isSpooky:
self.jack_o_lantern_is_lit = True
print ("Scary Pumpkins...")
def end_spooktober(self):
self.isSpooky = False
self.num_ghosts = 0
self.jack_o_lantern_is_lit = False
self.date = "November 1"
print ("End of Spooktober... See you next year!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment