Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 1 year ago

Max Alekseyev gravatar image

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:

click to hide/show revision 2
No.2 Revision

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: