def pattern_count(pattern, text):
    """
    The number of times that a pattern appears as a substring of text.

    Args:
        pattern (str): the substring pattern to find in the given text.
        text (str): the string space for looking.

    Returns:
        String, number of substring pattern that appears in text.

    Examples:
        Count the frequency (overlapping occurrences also counts) of a substring, i.e. pattern in the given string, i.e. text.

        >>> pattern = "GCG" 
        >>> text = "GCGCG"
        >>> count = pattern_count(pattern, text)
        >>> count
            2
    """
    count = 0
    for i in range(len(text) - len(pattern) + 1):
        if text[i:i + len(pattern)] == pattern:
            count = count + 1
    return count