Upper case first letter of each word in a phrase

前端 未结 10 1569
栀梦
栀梦 2020-12-03 21:08

Ok, I\'m trying to figure out how to make a inputed phrase such as this in python ....

Self contained underwater breathing apparatus

output

10条回答
  •  既然无缘
    2020-12-03 21:46

    Here's the quickest way to get it done

    input = "Self contained underwater breathing apparatus"
    output = ""
    for i in input.upper().split():
        output += i[0]
    

提交回复
热议问题