def attributes(elem, names, fmt="8.3f"):
    """
    Return a list of strings of all the attributes of ``elem`` specified in
    ``names``
    """

    return [
        "\t{0:s} = {1:{fmt}}".format(
            name.replace("_", " ").capitalize(), getattr(elem, name), fmt=fmt
        )
        for name in names
    ]