Skip to content

Commit 64302a1

Browse files
committed
[PGS] (재도전)JadenCase 문자열 만들기 / lv2 /20min
https://school.programmers.co.kr/learn/courses/30/lessons/12951
1 parent 7dd230a commit 64302a1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
def solution(s):
2+
answer = ""
3+
s = s.split(' ') # 1.단어별로 splite 된 list
4+
for i in range(len(s)) : #2.각 단어별로 맨 앞글자 대문자,그외 소문자로 변환
5+
#capitalize : 첫문자는 대문자,그외는 소문자로 만듦
6+
s[i] = s[i].capitalize()
7+
answer = " ".join(s)#3. 분리해둔 단어들을 한개의 str로 합치기
8+
9+
return answer

0 commit comments

Comments
 (0)