Discuss / Python / 笨方法

笨方法

Topic source

def normalize(name):

    str = name

    return (str[0].upper() + str[1].lower() + str[2].lower())

康纳252_951

#2 Created at ... [Delete] [Delete and Lock User]

str使用title() 就变成首字母大写,后面小写


  • 1

Reply