"""
--Lab 4 part 4---

You must use a for loop in all of these functions.

Think about whether each of these functions can be solved using an accumulator 
or search pattern (sometimes it could be a mix of both).

Write some examples in the docstring wherever specified.
"""

def count_non_alnum(s: str) -> int:
    """Return the total number of non-alphanumeric characters in s.

    >>> count_non_alnum('abc')
    0
    >>> count_non_alnum('$*@')
    3
    >>> [add another example here]
    
    >>> [add another example here]
    
    """
    # Accumulator or Search?: [put your answer here]
    
    # Add your code below
  
    

def is_valid_phone_number(s: str) -> bool:
    """Return whether s is a valid phone number.  A valid phone number has 
    only numbers and hyphens '-'.
    
    >>> is_valid_phone_number('111-222')
    True
    >>> [write some more example test cases] 
    
    >>>
    
    >>>
    
    """
    # Accumulator or Search: [put your answer here]
    
    # Add your code below
    


def repeat_character(s: str, ch: str) -> str:
    """Return a string consisting of ch repeated as many times as it 
    appears in s.
    
    >>> repeat_character('banana', 'a')
    'aaa'
    >>> repeat_character('bill', 'i')
    [replace this line with the expected output]
    
    >>> [write your own example here]
    
    
    
    Precondition: len(ch) = 1
    """
    # Accumulator or Search?: [put your answer here]
    
    # Add your code below




def contains_number_times(s: str, n: int) -> bool:
    """Return whether the string representation of single-digit number n 
    appears at least n times in s.
    
    >>> contains_number_times('a2b2', 2)
    True
    >>> contains_number_times('ab33cd33333', 3)
    True
    >>> contains_number_times('5hello55', 5)
    False
    
    Precondition: 1 <= n <= 9
    """
    
    # This function can use a combination of an accumulator and a 
    # search pattern:
    # We are accumulating the number of times n appears in the string, but we
    # can return immediately if we've accumulated enough of them.
    
    # Add your code below

