python練習

1.•利用 map() 函數,把用戶輸入的不規範的英文名字,變爲首字母大寫,其他小 寫的規範名字。輸入: ['adam', 'LISA', 'barT'] ,輸出: ['Adam', 'Lisa', 'Bart'] 。 In [4]: def fun(x):     return x.title()    ...: In [5]: map(fun,['adam', 'LISA', 'barT'])
相關文章
相關標籤/搜索