728x90
SMALL
def solution(s):
answer = ''
if len(s)%2==0:
answer=s[int(len(s)/2-1):int(len(s)/2+1)]
else:
answer=s[int(len(s)/2-0.5)]
return answer
728x90
LIST
'취준시절 > 프로그래머스' 카테고리의 다른 글
[프로그래머스] N개의 최소 공배수 - Python (0) | 2021.08.04 |
---|---|
[프로그래머스] 같은 숫자는 싫어 - Python (0) | 2021.07.09 |
[프로그래머스] x만큼 간격이 있는 n개의 숫자 - Python (0) | 2021.07.09 |
[프로그래머스] K번째 수 - Python (0) | 2021.07.09 |
[프로그래머스] 2016년 - Python (0) | 2021.07.09 |