Ok I'm having a error with my program. Which finds and displays all positive factors of an input integer. I either get it listing 1 factor num times or an error that I can't divide by zero but I don't know why.
I don't want a solution I just want a hint to what i'm doing wrong.
Code:
# User input
num = int(raw_input("Determine the factors of what number ? "))
# Display factors in one line
print "The factors are:",
# Variable set
test = 1
# Calcualte factors
for test in range(num):
if num%test == 0:
print num,
# Print a blank space
print
Comment