0

How do I get this code to print it’s output in a list?

n = int(input()) def facts(x): for i in range(1,x+1): for j in range(1,x+1): if x / i == j: print(i) print(facts(n))

8/25/2019 10:56:18 PM

Evan

2 Answers

New Answer

+2

How do I get this code to print it’s output in a list? n = int(input()) lst = [] def facts(x): for i in range(1,x+1): for j in range(1,x+1): if x / i == j: lst.append(i) return lst print(facts(n))

0

Append those values into a empty list.. then print it.