初学者,写了下每日一坑1的解答,但是执行结果不理想。请大家帮忙分析下问题出在哪里了,谢谢
class Lottery:
def __init__(self,m,n):
self.m=m+1
self.n=n
def Doublecolor(self):
import random
self.a={}
for i in range(1,self.m):
b=random.randint(1,self.n)
if b not in self.a:
self.a[i]=b
else:
self.m=self.m+1
return self.a
c=Lottery(15,40)
print c.Doublecolor()
print c.m