One of the files (dessert.py) creates all the templates for all 4 desserts we can create. We
Fantastic news! We've Found the answer you've been seeking!
Question:
One of the files (dessert.py) creates all the templates for all 4 desserts we can create. We added a __str__ method to print to the terminal the information of the specific dessert formatted in a specific way, in this example below __str__ returns Candy formatted in a more readable way.
The second file, dessertshop.py, creates an Order from all the instances of desserts from dessert.py.
The goal is to add another __str__ method in the Order class to ultimately format the candy I created and passed to myself order like this:
Gummy Bears | 0.25lbs | $0.35/lb | $0.09 | $0.01 |
How can I write the __str__ method here to format my instance of Candy towards the bottom of dessertshop.py?
Related Book For
Systems analysis and design
ISBN: 978-0136089162
8th Edition
Authors: kenneth e. kendall, julie e. kendall
Posted Date: