def first_first(name): """ Input: Name Output: First name appears first and last name appears last """ parts = name_parser.split(name) return " ".join([p for p in parts if p])
def last_first(name): """ Input: Name Output: Last name appears first and first name appears last """ pre, fp, lp, suf = name_parser.split(name) if lp: lp += ", " return lp + " ".join([p for p in [pre, fp, suf] if p])
def last_initial(name): """ Input: Name Output: Last Name in Abbrevated form """ pre, fp, lp, suff = name_parser.split(name) if lp: lp = lp[0] return " ".join([p for p in [pre, fp, lp, suff] if p])
def initial_initial(name): """ Input: Name Output: First Name in Abbrevated form """ pre, fp, lp, suff = name_parser.split(name) if fp: fp = fp[0] return " ".join([p for p in [pre, fp, lp, suff] if p])
def last_only(name): """ Input: Name Output: Last Name """ return name_parser.split(name)[2]