def format_heading(level, text):
    """Create a heading of <level> [1, 2 or 3 supported]."""
    underlining = {(0): '', (1): '=', (2): '-', (3): '~'}
    return '{}\n{}\n\n'.format(text, underlining[level] * len(text))
