Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Your loop for factor in factors: assigns an integer value to factor object. So, you cannot call factor(p-1) afterwards.

A simply fix is to give the loop variable another name - e.g. for myfactor in factors:

Your loop for factor in factors: assigns an integer value to factor object. So, you cannot call factor(p-1) afterwards.

A simply simple fix is to give the loop variable another name - e.g. for myfactor in factors: