정수 리스트 num_list와 정수 n이 주어질 때, num_list의 첫 번째 원소부터 n 번째 원소까지의 모든 원소를 담은 리스트를 return하도록 solution 함수를 완성해주세요.
def solution(num_list, n):
answer = []
for i in range(0, n):
answer.append(num_list[i])
return(answer)
'일기장' 카테고리의 다른 글
특수문자 출력하기 (0) | 2023.08.01 |
---|---|
대소문자 바꿔서 출력하기 (0) | 2023.08.01 |
카운트 업 (0) | 2023.08.01 |
쿠키와 세션 (0) | 2023.08.01 |
IP Address (0) | 2023.08.01 |