#P1
def normalize(name):
def normalize1(a):
return a[0].upper()+a[1:].lower()
return map(normalize1,name)
#P2
from functools import reduce
def prod(L):
def multiple(x,y):
return x*y
return reduce(multiple,L)
#P3
def str2float(s):
def str2(x,y):
return x*10+y
def str3(x,y):
return x/10+y
s1,s2=s.split('.')
s2=s2[::-1]
a1=reduce(str2,map(int,s1))
a2=reduce(str3,map(int,s2))/10
return a1+a2
Sign in to make a reply
blabla有理想
#P1
def normalize(name):
def normalize1(a):
return a[0].upper()+a[1:].lower()
return map(normalize1,name)
#P2
from functools import reduce
def prod(L):
def multiple(x,y):
return x*y
return reduce(multiple,L)
#P3
def str2float(s):
def str2(x,y):
return x*10+y
def str3(x,y):
return x/10+y
s1,s2=s.split('.')
s2=s2[::-1]
a1=reduce(str2,map(int,s1))
a2=reduce(str3,map(int,s2))/10
return a1+a2