반응형
def solution(s):
s_arr = s.split(" ")
result = ""
for count in range(len(s_arr)):
for idx in range(len(s_arr[count])):
if idx % 2 == 0:
result += s_arr[count][idx].upper()
else:
result += s_arr[count][idx].lower()
result += "" if count == len(s_arr)-1 else " "
return result
반응형
'삽집하는 개발들 > 알고리즘' 카테고리의 다른 글
[29일차][프로그래머스][12940]최대공약수와 최소공배수 (0) | 2023.07.22 |
---|---|
[29일차][프로그래머스][12982][Summer/Winter Coding(~2018)]예산 (0) | 2023.07.22 |
[27일차][프로그래머스][12940]같은 숫자는 싫어 (0) | 2023.07.18 |
[27일차][프로그래머스][12969]직사각형 별찍기 (0) | 2023.07.18 |
[27일차][프로그래머스][12950]행렬의 덧셈 (0) | 2023.07.18 |