def format_timedelta(td):
    """
    Format a timedelta

    Args:
        td (datetime.timedelta): A timedelta

    Returns:
        str: A string which represents the timedelta

    Examples:
        >>> import datetime
        >>> td = datetime.timedelta(days=3)
        >>> format_timedelta(td)
        '3 days'
        >>> td = datetime.timedelta(days=1)
        >>> format_timedelta(td)
        '1 day'
        >>> td = datetime.timedelta(seconds=14.2567)
        >>> format_timedelta(td)
        '14.26 seconds'
        >>> td = datetime.timedelta(seconds=64.6734)
        >>> format_timedelta(td)
        '1 minute 4.67 seconds'
        >>> td = datetime.timedelta(seconds=3600)
        >>> format_timedelta(td)
        '1 hour'
        >>> td = datetime.timedelta(seconds=3673.123)
        >>> format_timedelta(td)
        '1 hour 1 minute 13.12 seconds'
        >>> td = datetime.timedelta(seconds=.878)
        >>> format_timedelta(td)
        '0.88 seconds'
        >>> td = datetime.timedelta(seconds=0)
        >>> format_timedelta(td)
        '0 seconds'
        >>> td = datetime.timedelta(seconds=1)
        >>> format_timedelta(td)
        '1 second'
        >>> td = datetime.timedelta(seconds=1.234)
        >>> format_timedelta(td)
        '1.23 seconds'
    """
    if not td:
        return '0 seconds'

    parts = []
    if td.days:
        parts.append('{} day{}'.format(td.days, 's' if td.days > 1 else ''))

    if td.seconds or td.microseconds:

        hours = td.seconds // 3600

        if hours:
            parts.append('{} hour{}'.format(hours, 's' if hours > 1 else ''))
            minutes = (td.seconds % 3600) // 60
            seconds = (td.seconds % 3600) % 60
        else:
            minutes = td.seconds // 60
            seconds = td.seconds % 60

        if minutes:
            parts.append('{} minute{}'.format(
                minutes,
                's' if minutes > 1 else '',
            ))
        if seconds or td.microseconds:
            hundredths = int(round(td.microseconds / 10000.))
            f_hundredths = '.{}'.format(hundredths) if hundredths else ''
            parts.append('{}{} second{}'.format(
                seconds,
                f_hundredths,
                '' if (seconds == 1 and not f_hundredths) else 's',
            ))

    return ' '.join(parts)