Discuss / Python / 高价函数练习1~3

高价函数练习1~3

Jack

#1 Created at ... [Delete] [Delete and Lock User]
#其实练习一非常简单,只需要几行代码
def normalize(name):
    return name.title()#title()函数可以将字符串首字母大写其他变成小写

# 测试:L1 = ['adam', 'LISA', 'barT']
L2 = list(map(normalize, L1))
print(L2)

  • 1

Reply