[英]how write function to calculate the divisor?
我正在嘗試編寫函數來計算除數但無法完成它 .python 3
我的代碼
def divisor(x):
c=0
for i in range(1, 10000):
d=x % i
if d==0:
c+=1
我不知道接下來要做什么。請指導
def divisor(x):
c=0
y=[]
for i in range ( 1,x+1):
x % i
if x % i ==0:
c+=1
q=y.append(c)
q=max(y)
return q
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.