def authorlist_to_string(authorlist):
    """
    Function to convert a list of author names
    into a readable string, for example,
    ['X', 'Y', 'Z'] -> 'X, Y and Z'.
    """
    if len(authorlist) > 1:
        authors = '{} and {}'.format(', '.join(authorlist[:-1]), authorlist[-1])
    else:
        authors = authorlist[0]

    return authors