[Level 1] 가운데 글자 가져오기

나며기·2021년 9월 10일
0

programmers

목록 보기
24/111
post-thumbnail
import math

def solution(s):
    f = math.floor(len(s)/2)
    c = math.ceil(len(s)/2)
    if f == c:
        return s[f-1:c+1]
    return s[f:c]
profile
PLUS ULTRA

0개의 댓글