用户:Dreamer.查看:0 回复:4 评论:0 创建时间:2020-02-04T16:30:15
【作品展示】

【作品介绍】
大哥大姐们
【作品源代码】
import random
class d:
def __init__(self, begin, end, needcount):
self.begin = begin
self.end = end
self.needcount = needcount
self.resultlist = []
self.count = 0
def d(self):
tempInt = random.randint(self.begin, self.end)
if(self.count < self.needcount):
if(tempInt not in self.resultlist):
self.resultlist.append(tempInt)
self.count += 1
return self.d()
return self.resultlist
a=d(1,33,6)
print(a.d())
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn