def name_in_initials(name):
    """John Doe -> J. Doe"""
    name = name.split()
    first_name = name[:-1]
    last_name = name[-1]
    name = [n[0] + "." for n in first_name]
    name.append(last_name)
    return " ".join(name)