Nov-23-2017, 02:33 AM
hi,thanks for looking my post
for now i am able to fulfill it through a lambada funtion:
l = ['java','python','c++'] #a list of string
a = list(map(lambda x: x.title() ,l)) #using map and title funtion upper every first letter
a
anyway,i really want to know how to achieve it without lambda funtion,like define a funtion first then using the 'map'
i tried but none of these works
def title1(x): #define a function name title1
c=x.title()
return c
can anyone point out what;s the matter with my code?thanks