Greetings!
I've been struggling with printing my list elements, called from a method.
Have been trying to approach this from all kinds of angles, but got stuck on each attempt.
Here is my code:
I've been struggling with printing my list elements, called from a method.
Have been trying to approach this from all kinds of angles, but got stuck on each attempt.
Here is my code:
class Restaurant(): """A simple attempt to model a restaurant""" def __init__(self, restaurant_name, cuisine_type): """Initialize name and cuisine attributes""" self.restaurant_name = restaurant_name self.cuisine_type = cuisine_type def describe_restaurant(self): """Print restaurant name and cuisine type""" print("Welcome to " + self.restaurant_name.title() + ".") print("We serve a healthy variety of dishes to suit your palette, most of our food is based on " + self.cuisine_type + ".") def open_restaurant(self): """Display a message that the restaurant is open""" print(self.restaurant_name.title() + " is open!") class IceCreamStand(Restaurant): """Represents aspects of a restaurant, specific to an Ice-cream stand.""" def __init__(self, flavors, restaurant_name, cuisine_type): """Initialize attributes to describe flavors in the Ice-cream stand""" super().__init__(flavors, restaurant_name, cuisine_type) self.flavors = ['lemon', 'malaga', 'pistacio', 'mocca'] self.restaurant_name = restaurant_name self.cuisine_type = cuisine_type #This last part seems to be the issue: def flavors(self, flav): for flavors in self.flavors: print(flavor) self.flav = ice_stand.flavors() ice_stand = IceCreamStand(self.flav, 'ice', 'ok')Any help is appreciated!