[프로그래머스] x만큼 간격이 있는 n개의 숫자

단간단간·2024년 4월 22일
0

알고리즘 문제

목록 보기
75/106

문제 링크:

https://school.programmers.co.kr/learn/courses/30/lessons/12954

python

def solution(x, n):
    return [x * i for i in range(1, n + 1)]


if __name__ == "__main__":
    result = solution(2, 5)
    print(result)
[2, 4, 6, 8, 10]
profile
simple is best

0개의 댓글