fork download
  1. def normalize(name):
  2. capitalized_name = name.capitalize() # 首字母大写,其他小写
  3. return capitalized_name # 返回规范化的名字
  4.  
  5.  
  6. # 测试:
  7. L1 = ['adam', 'LISA', 'barT']
  8. L2 = list(map(normalize, L1))
  9. print(L2)
  10. # your code goes here
Success #stdin #stdout 0.11s 14172KB
stdin
Standard input is empty
stdout
['Adam', 'Lisa', 'Bart']