Build a Musical Instrument Inventory - Step 6

Tell us what’s happening:

I’m getting an error to print the name attribute of instrument_1

class MusicalInstrument:
def init(self, name, instrument_type):
self.name = name
self.instrument_type = instrument_type

instrument_1 = MusicalInstrument(‘Oboe’, ‘woodwind’)
instrument_2 = MusicalInstrument(‘Trumpet’, ‘brass’)
print(instrument_1.name, instrument_1.instrument_type)
print(instrument_2.name, instrument_2.instrument_type)

Your code so far


# User Editable Region

class MusicalInstrument:
    def __init__(self, name, instrument_type):
        self.name = name
        self.instrument_type = instrument_type

instrument_1 = MusicalInstrument('Oboe', 'woodwind')
instrument_2 = MusicalInstrument('Trumpet', 'brass')
print(instrument_1.name, instrument_1.instrument_type)
print(instrument_2.name, instrument_2.instrument_type)

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36

Challenge Information:

Build a Musical Instrument Inventory - Step 6

Try to print them separately, not on the same line.

Yes, I saw that right after I posted in the forum lol. I frustrated myself

Thanks