Tried writingg the code using 1st type of algorithm of the video


#1

I have tried to write the code using the 1st type of algorithm shown in the video where the time complexity is O(n). But unable to run the code. please share your suggestions mate!

def allFactors(self, n):
A={1,n}
for i in range(2,n/2):
if n%i==0:
A.append(i)
allFactors(6)
return A;