Skip to content

Week 4 Assignment#1

Open
karlalopez wants to merge 1 commit intojennielees:masterfrom
karlalopez:master
Open

Week 4 Assignment#1
karlalopez wants to merge 1 commit intojennielees:masterfrom
karlalopez:master

Conversation

@karlalopez
Copy link
Copy Markdown

I'm not sure it's working but it's passing the tests. Also, in the desserts() and cakes() methods, I feel like I don't understand what's going on.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need to do this, although it works! initializing your parent is mostly done if you really need to call whatever logic is inside its __init__. if it's just a case of creating constant values, you can define them at the class level:

class Cake(Dessert):
    price = 5
    calories = 200

   def __init__(self, kind):
     ... etc ...

then self.price will always be 5 for a Cake, and so on.

@jennielees
Copy link
Copy Markdown
Owner

well you got it all looking good, apart from that one comment! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants