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


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):
for i in range(2,n/2):
if n%i==0:
return A;