def int_to_note(note_int, accidentals='#'):
    """Convert integers in the range of 0-11 to notes in the form of C or C#
    or Db.

    Throw a RangeError exception if the note_int is not in the range 0-11.

    If not specified, sharps will be used.

    Examples:
    >>> int_to_note(0)
    'C'
    >>> int_to_note(3)
    'D#'
    >>> int_to_note(3, 'b')
    'Eb'
    """
    if note_int not in range(12):
        raise RangeError('int out of bounds (0-11): %d' % note_int)
    ns = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B']
    nf = ['C', 'Db', 'D', 'Eb', 'E', 'F', 'Gb', 'G', 'Ab', 'A', 'Bb', 'B']
    if accidentals == '#':
        return ns[note_int]
    elif accidentals == 'b':
        return nf[note_int]
    else:
        raise FormatError("'%s' not valid as accidental" % accidentals)