def compose(lead, medi, tail=0):
    """
    Compose hangul using given consonant and vowel
    :param lead:  lead consonant
    :param medi:  medial vowel
    :param tail: tail consonant if any
    :return: composed hangul character
    """
    tail_remainder = None

    lead = JA_LEAD.index(lead) * 588
    medi = MO.index(medi) * 28
    if tail:
        try:
            tail = JA_TAIL.index(tail)
        except ValueError:
            tail_remainder = tail
            tail = 0

    ccode = lead + medi + tail + 0xAC00
    return [chr(ccode)] if not tail_remainder else [chr(ccode), tail_remainder]
def compose ( lead , medi , tail = 0 ) : tail_remainder = None lead = JA_LEAD . index ( lead ) * 588 medi = MO . index ( medi ) * 28 if tail : try : tail = JA_TAIL . index ( tail ) except ValueError : tail_remainder = tail tail = 0 ccode = lead + medi + tail + 0xAC00 return [ chr ( ccode ) ] if not tail_remainder else [ chr ( ccode ) , tail_remainder ]
Compose hangul using given consonant and vowel
    :param lead:  lead consonant
    :param medi:  medial vowel
    :param tail: tail consonant if any
    :return: composed hangul character