Python/백준 알고리즘
[백준][Python3] #9086. 문자열
2nan
2024. 2. 28. 16:51
728x90
코드 입력
def print_(word):
"""
단어의 첫 글자와 마지막 글자만 뽑는 함수
"""
start = word[0]
end = word[-1]
return start + end
cnt = int(input())
# 처음 주어진 횟수만큼 루프문 생성
for _ in range(cnt):
start_end = print_(input())
print(start_end)
출처 : 백준 Online Judge