Your last 2 lines would be modified thusly
primeNum = int(raw_input("Enter number here:"))
prime_list = listfactors(primeNum) ## your function returns a list
for prime in prime_list:
print "prime =", prime
Also, a second for using modulo or divmod. Your function compares integers and floats and you will be comparing numbers like int=1, and float=0.99999 because of the nature of using floats which will always test false. Hopefully you are only testing integers for "primeness" and so should work with integers only. Finally, it is bad form to use "i", "l", or "o" as single letter variables, as they look too much like numbers.
Last edited by woooee; Dec 5th, 2008 at 12:03 am.
Reputation Points: 741
Solved Threads: 691
Nearly a Posting Maven
Offline 2,302 posts
since Dec 2006