def __init__(self, color='silver', name='jetpack', max_size=2, fuel=10): """constructor for a jetback object Inputs: color (str, opt) default is silver name(str, opt) default is jetpack max_size (int, opt) deafult is 2 feul (int, opt) default is 10 returns a jetpack with no contents""" Backpack.__init__(self, color, name, max_size) """ this calls the backpack object which is used to create the Jetpack object""" self.fuel = fuel
def __init__(self, color='silver', name='jetpack', max_size=2, fuel = 10): """ Constructor for jetpacks. Holds 2 items, has fuel attribute. Inputs: color(str): color, defaults to silver name(str): name, defualts to jetback max_size(int): max number of elemetns, defaults to 2 Fuel(int): Defaults to 10. Amount of fuel left in jetpack Returns: an empty contented, 10 fuel filled silver jetpack """ Backpack.__init__(self, color, name, max_size) self.fuel = 10
def __init__(self, color='silver', name='jetpack', max_size=2, fuel=10): """ Constructor for jetpacks. Holds 2 items, has fuel attribute. Inputs: color(str): color, defaults to silver name(str): name, defualts to jetback max_size(int): max number of elemetns, defaults to 2 Fuel(int): Defaults to 10. Amount of fuel left in jetpack Returns: an empty contented, 10 fuel filled silver jetpack """ Backpack.__init__(self, color, name, max_size) self.fuel = 10
def __init__(self, color='brown', name='knapsack', max_size=3): """Constructor for a knapsack object. A knapsack only holds 3 item by default instead of 5. Use the Backpack constructor to initialize the name and max_size attributes. Inputs: color (str, opt): the color of the knapsack. Defaults to 'brown'. name (str, opt): the name of the knapsack. Defaults to 'knapsack'. max_size (int, opt): the maximum number of items that can be stored in the knapsack. Defaults to 3. Returns: A knapsack object with no contents. """ Backpack.__init__(self, color, name, max_size) self.closed = True