def gc(seq):
    """ Calculates GC content

    Args:
        seq (str): non empty
    Returns:
        GC content (float)
    Raises:
        ValueError: if the sequence is None or empty str
    """
    if not seq:
        raise ValueError("Input must be non-empty string")

    g = seq.count("G")
    c = seq.count("C")

    return (g + c) / len(seq)