-
-
Save jramos70/1a71e58250f034fdbd4de0c806082ed4 to your computer and use it in GitHub Desktop.
DLA Experiment - Week 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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