from datetime import datetime


def time_to_resolve(time_received, time_resolved):
    """Returns the time taken to resolve an issue.

    Args:
        time_received (datetime): Datetime showing when ticket was received.
        time_resolved (datetime): Datetime showing when ticket was received.

    Returns:
        Time taken to resolve issue in hours.
    """

    time_received = datetime.strptime(time_received, "%Y-%m-%d %H:%M:%S")
    time_resolved = datetime.strptime(time_resolved, "%Y-%m-%d %H:%M:%S")
    time_to_resolve = ((time_resolved - time_received).seconds / 60) / 60

    return time_to_resolve