def instrument_to_insCode(instrument):
    """Given a pretty_midi.Instrument object, returns a concise string code representing its program number & its is_drum parameter.

    Parameters
    ----------
    instrument : pretty_midi.Instrument
        object of pretty_midi.Instrument class.

    Returns
    -------
    code : str 
        concatenation of MIDI program code (as decimal) and ("d" if instrument.is_drum is True else "n").
    """    
    code = str(instrument.program)
    
    if instrument.is_drum:
        code += "d"
    else:
        code += "n"    
    return code