난이도: 레벨2
https://school.programmers.co.kr/learn/courses/30/lessons/12951
lower(), upper(), ''.join(리스트) 메소드를 알아야 쉽게 풀 수 있다.
def solution(s):
s= s.lower()
s = list(s)
s[0] = s[0].upper()
for i in range(len(s)):
if s[i] ==' ' and i!=len(s)-1 :
s[i+1] = s[i+1].upper()
ans = ''.join(s)
print(ans)
return ans
'Problem Solving > 구현' 카테고리의 다른 글
약수의 개수와 덧셈 (0) | 2023.11.13 |
---|---|
과제진행하기 (0) | 2023.10.17 |
짝수와 홀수 (0) | 2023.09.17 |
자릿수 더하기 (0) | 2023.09.17 |
최댓값과 최솟값 (0) | 2023.09.16 |