Discuss / Python / 偷奸耍滑的测试成功!

偷奸耍滑的测试成功!

Topic source

脑洞开天

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

练习一:

def normalize(name):
        return name.capitalize()

练习二:

def prod(L):
    return reduce(lambda x,y:x*y ,L)

练习三:

def str2float(s):
    a,b=s.split('.')
    return int(a) + int(b)*10**(-(len(s)-s.index('.')-1))
真不知道怎么用reduce,map

  • 1

Reply