TypeError: Find_Number() missing 1 required positional argument: 'limitdivision'
我仍然不明白为什么我的代码是错误的:
def main():
obj = FindMaxNumber()
result = obj.Final_Result(500)
print("The Final Result is {} ". format(result))
class FindMaxNumber():
delf Find_Division(self, num):
self.num = num
if num%2==0:
num = num/2
count = 0
division = 1
while num%2==0:
count+=1
num = num/2
division=division*( count + 1 )
div = 3
while num != 1:
count = 0
while num%div==0:
count+=1
num = num/div
division = division( count + 1)
div+=2
return division
def Find_Number(self, limitdivision):
self.limitdivision = limitdivision
n = 1
inum , fnum = FindMaxNumber.Find_Division(n) , FindMaxNumber.Find_Division(n+1)
while inum*fnum < limitdivision:
n+=1
inum , fnum = fnum , FindMaxNumber.Find_Division(n+1)
return inum
def Final_Result(self , index):
self.index = index
num = FindMaxNumber.Find_Number(index)
final = (num(num+1)/2)
return final
if __name__=="__main__": main()
谁能告诉我支持用这段代码做什么?