diff --git a/1/1.9 Mad Lib/mad_lib/mad_lib.py b/1/1.9 Mad Lib/mad_lib/mad_lib.py index 8a2b393..321eec3 100644 --- a/1/1.9 Mad Lib/mad_lib/mad_lib.py +++ b/1/1.9 Mad Lib/mad_lib/mad_lib.py @@ -2,8 +2,12 @@ # Construct a mad lib class mad_lib: + # Initalize a constructor for python mad lib def __init__(self, lib): + # lib is a value passed in during the construction of this class self.text = lib + + # Replace %text% with user input self.text = self.text.replace('%first_name%', self.first_name()) self.text = self.text.replace('%location%', self.location()) self.text = self.text.replace('%whole_number%', self.whole_number()) @@ -30,4 +34,4 @@ class mad_lib: # Construct a mad lib md = mad_lib('%first_name% went to %location% to buy %whole_number% different types of %plural_noun%') -print(md.text) \ No newline at end of file +print(md.text)