"""
CSC120 Fall 2018 - Exercise 3
This file contains the functions for E3.
Note: Do NOT leave any print statements in
this file when you submit it.
"""

def sum_digits(s: str) -> int:
    """Return the sum of all of the digits in s.

    >>> sum_digits('abc123')
    6
    >>> sum_digits('!5-5@')
    10
    >>> sum_digits('hello')
    0
    """
    
    # Add your code here
    

def is_valid_product_number(s: str) -> bool:
    """Return True iff s is a valid product number.  All characters in a 
    valid product number must be only capital letters, numbers, or hyphens '-'.
    
    >>> is_valid_product_number('AB74E-FG3HI')
    True
    >>> is_valid_product_number('abcd.1234')
    False
    """
    
    # Add your code here


def number_times(s: str) -> str:
    """Return a string consisting of every single-digit number in s repeated 
    the same number of times as the value of each digit.
    
    >>> number_times('123')
    '122333'
    >>> number_times('74')
    '77777774444'
    
    Precondition: all characters in s are digits (you don't need to check).
    """
    
    # Add your code here


def has_n_times(s: str, char: str, n: int) -> bool:
    """Return True iff s contains the character char *exactly* n times.
    
    >>> has_n_times('hello', 'l', 2)
    True
    >>> has_n_times('banana', 'a', 4)
    False
    
    Precondition: len(char) = 1, n >= 0
    """    
    
    # Add your code here

