[Solved] How to find the factors of all the numbers in a list in python 3? [closed]


This should print the factors for each of the numbers in your list. First we will go through each of the numbers, assume one of these numbers is 4. Then we will go through [1,2,3,4] and find out which of these is a factor of 4. Turns out its [1,2,4].

n = [3,4,5]
for i in n:
    print('Factors of ', i)
    for j in range(1,i+1):
        if i%j == 0:
            print(j)

0

solved How to find the factors of all the numbers in a list in python 3? [closed]