Discuss / Python / 作业三

作业三

Topic source

作业三:

    x = s.split('.')

    p = 0

    xx = list(map(int, x[1]))

    for i in range(len(xx)):

        p = xx[i]/(10 ** (i+1)) + p

    x[1] = p

    def f(z, y):

        return z+y

    L1 = list(map(float, x))

    print(L1)

    L2 = reduce(f, L1)

    return L2


  • 1

Reply