Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 37
Image: ubuntu2004
def DirectoryAttack(A,B=[]): if len(B)<1: B=A for i in xrange(0,len(A)): for j in xrange(0,len(B)): ijgcd = gcd(A[i],B[j]) if (ijgcd>1) and (A[i]!=B[j]): print ("The common factor of {0} and {1} is {2}".format(A[i],B[j],ijgcd))
DirectoryAttack([1,2,3],[3,6,7])
The common factor of 2 and 6 is 2 The common factor of 3 and 6 is 3