def count(ch, str):
    """
    this program could count the number of the chosen digit in a string
    :param ch: str, the chosen digit
    :param str: str, the string that being counted
    :return: int, times of the chosen digit appear
    """
    num = 0
    for i in range(len(str)):
        if str[i] == ch:
            num += 1
        else:
            pass
    return num