Sep-02-2018, 11:53 PM
(This post was last modified: Sep-03-2018, 12:40 AM by ichabod801.)
So I'm creating a code that will take on number look for all the factors of that number and then tell me what factors are prime and which ones are not
num = (random number) <==This a preinputed number.
Thanks for the help, Wikki14
num = (random number) <==This a preinputed number.
def print_factors(x): print("factors of", x,"are:") for i in range(1,x + 1): if x % i ==0: print(i) print_factors(num)I think the way to do it would be to have the program put all the factors into a list and then run a prime number program through it but I don't know how to do that and would love the help/criticism or whatever you have.
Thanks for the help, Wikki14