import string
import random


def generate_digits(size=3, chars=string.digits):
    """Randomly generate a number with length `size`.

    Args:
        size (int): Length of the number.
        chars (str): The char appeared in this string will be considered as
        one of the choice.

    Returns:
        A number (str).
    """
    return ''.join(random.choice(chars) for _ in range(size))