def isleapyear(yr):
    """Detects if a year is a leap year and returns T or F accordingly"""
    if yr % 4 == 0 and yr % 100 != 0:
        return True
    elif yr % 400 == 0:
        return True
    elif yr % 100 == 0:
        return False
    else:
        return False