프로그래머스 가운데 글자 가져오기

yoonene·2021년 12월 17일
0

알고리즘

목록 보기
14/62
def solution(s):
    l = len(s)
    if l % 2 != 0:
        return s[l//2]
    else:
        return s[l//2-1:l//2+1]
profile
NLP Researcher / Information Retrieval / Search

0개의 댓글