Q: Python factors of a number Prompt the user to input a number. Print out all factors of that number.
number = (input("Enter a number: "))

string = ""

for i in range(2, int(number)):

    if int(number) / i == 0:

        string = string + str(i)

print(string)

Why is this not returning anything?

A: You have to replace if int(number) / i == 0: with if int(number) % i == 0:, as you're getting the quotient, not the remainder

A: Try this:
number = int(input("Enter a number: "))
string = ' '.join([str(i) for i in range(2, number + 1) if number % i == 0])

print(string)

