Programmers/프로그래머스-약수 구하기-Python

cosmos·2023년 3월 13일
0
post-thumbnail

문제

코드

# https://school.programmers.co.kr/learn/courses/30/lessons/120897
# programmers, level0: 약수 구하기, python3
def solution(n: int) -> list:
    answer = []

    for i in range(1, n + 1):
        if (n % i == 0) :
            answer.append(i)
            
    return answer

결과

출처 & 깃허브

프로그래머스
github

0개의 댓글