#第一题:
return name[:1].upper()+name[1:].lower() #不用title,第一个字母大写,其余字母小写。
#第二题:
return reduce(lambda x,y:x*y,L)
#第三题:
d1 = {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9}
return reduce(lambda x,y:x*10+y,map(lambda n:d1[n],s.replace(".","")))/(10**(len(s)-1-s.index('.')))
Sign in to make a reply
居士先生
#第一题:
return name[:1].upper()+name[1:].lower() #不用title,第一个字母大写,其余字母小写。
#第二题:
return reduce(lambda x,y:x*y,L)
#第三题:
d1 = {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9}
return reduce(lambda x,y:x*10+y,map(lambda n:d1[n],s.replace(".","")))/(10**(len(s)-1-s.index('.')))