Brute force

The Champernowne constant is a number obtained by concatenating positive integers in decimal form. The simplest way to solve this problem is to create a string with the required 1000000 digits and then extract the ones we need.

In Python, we can use the built-in join method to construct this string easily. This function creates a string which is the concatenation of an iterable ; a range of integers in our case.

The final result is the product of the digits we need. Combining the reduce function from the functools module and the int function with operator.mul, we can get the product of a iterable of integers.

From solution1.py:

def champernownes_constant():
    s = "".join(str(i) for i in range(1, 1000000))
    print([int(s[10**i - 1]) for i in range(7)])
    return reduce(operator.mul, (int(s[10**i - 1]) for i in range(7)))