def get_middle(s):
    str_len = len(s)
    if str_len % 2 == 1:
        return s[str_len // 2]
    else:
        return s[(str_len // 2) - 1:(str_len // 2)+1]

if __name__=="__main__":
    print(get_middle('middle'))
7942b655e54f4b564629f01cc19683c30c28550f
<mask token>

def get_middle(s):
    str_len = len(s)
    if str_len % 2 == 1:
        return s[str_len // 2]
    else:
        return s[str_len // 2 - 1:str_len // 2 + 1]


<mask token>

def get_middle(s):
    str_len = len(s)
    if str_len % 2 == 1:
        return s[str_len // 2]
    else:
        return s[str_len // 2 - 1:str_len // 2 + 1]


if __name__ == '__main__':
    print(get_middle('middle'))

def get_middle(s):
    str_len = len(s)
    if str_len % 2 == 1:
        return s[str_len // 2]
    else:
        return s[(str_len // 2) - 1:(str_len // 2)+1]

if __name__=="__main__":
    print(get_middle('middle'))