Discuss / Python / 作业3

作业3

Topic source

张康除

#1 Created at ... [Delete] [Delete and Lock User]

模仿着高圆圆姐姐写的,还得再复习,运用了没学过的知识点

    def a(x,y):
        return x*10 + y
    n=s.index('.')
    left=list(map(int,s[0:n]))
    right=list(map(int,s[n+1:]))
    f=reduce(a,left) + reduce(a,right)/(10**len(right))
    return f

  • 1

Reply