Tell us what’s happening:
halloo i have some confuse to pass step 9 please explain to me how to fix it.
Your play method should use an f-string to display the message The [instrument name] is fun to play!. Use self.name to access the instrument name.
Your code so far
# User Editable Region
class MusicalInstrument:
def __init__(self, name, instrument_type):
self.name = name
self.instrument_type = instrument_type
def play(self):
print(f'the {self.name} is fun to play!')
# User Editable Region
instrument_1 = MusicalInstrument('Oboe', 'woodwind')
instrument_2 = MusicalInstrument('Trumpet', 'brass')
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36
Challenge Information:
Build a Musical Instrument Inventory - Step 9