会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
今生A
博客园
首页
新随笔
联系
订阅
管理
2017年10月8日
python去不重复的随机数
摘要: 1 import random 2 3 x = int(input('请输入题库:')) 4 y = int(input('请输入次数:')) 5 sep = list(range(1,x+1)) 6 a = random.sample(sep,y) 7 a.sort() 8 print(a)
阅读全文
posted @ 2017-10-08 16:20 今生A
阅读(1658)
评论(0)
推荐(0)
公告