-
capitalize_every_word카테고리 없음 2022. 1. 28. 01:02
https://www.30secondsofcode.org/python/s/capitalize-every-word?from=recommendations
capitalize_every_word - 30 seconds of code
Capitalizes the first letter of every word in a string.
www.30secondsofcode.org
a.upper() : 문자열 전체를 대문자화
a.title() : 문자열의 첫 글자만 대문자화
def cap_every_word(): word = "helloWorld!" cap_word = word.upper() first_word = word.title() print(cap_word, first_word) # 출력 문자열 : HELLOWORLD! Helloworld!
반응형