Discuss / Python / 前两题答案

前两题答案

Topic source

第一题: # -- coding: utf-8 --

def normalize(name): name=name.title() return name

第二题: # -- coding: utf-8 --

def prod(L): if not isinstance(L,list): raise TypeError('bad operand type') def cj(x,y): return x*y return reduce(cj,L)


  • 1

Reply