热门

最新

红包

立Flag

投票

同城

我的

发布
agatha__
agatha__
4 年前
trueagatha__

这个博客的标志是一只猿戴着眼镜!哈哈哈太形象了吧,尤其是眼镜。唉,我的视力啊.......

CSDN App 扫码分享
分享
评论
3
打赏
  • 复制链接
  • 举报
下一条:
求大神指点,只循环10次,怎么写代码def ball__name(red,blue): '''红色的乒乓球33个,输出6个不同的数字, 蓝色的乒乓球16个,输出1个 ''' import random tone = [] while True: reds = random.randint(1,33) if reds not in tone: tone.append(reds) if len(tone) == 6: tone.sort() #print(tone) blues = random.randint(1,16) tone.append(blues) break print(tone) for i in range(ball__name(red,blue)): i += ball__name(red,blue) print(i) continueball__name(1,1)
立即登录