Exercise: Creating a Recipe Data Class

Create a Recipe data class. Include the following fields:

  • name
  • ingredients
  • cooking_time
  • difficulty

Assign the default value "easy" to the difficulty field. You can customize the data class further if you wish.

Test run your data class by creating several recipes and share them on the forum!


Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

You must own this product to join the conversation.