<filename>040.py


if __name__ == "__main__":
    s = "".join(str(i) for i in range(1, 1000000))
    ans = 1
    for i in range(7):
        ans *= int(s[10**i-1])
    print(ans)

<filename>040.py


if __name__ == "__main__":
    s = "".join(str(i) for i in range(1, 1000000))
    ans = 1
    for i in range(7):
        ans *= int(s[10**i-1])
    print(ans)
