码迷,mamicode.com
首页 > 编程语言 > 详细

python 将一个列表乱序

时间:2018-11-15 22:35:51      阅读:342      评论:0      收藏:0      [点我收藏+]

标签:port   class   color   rand   pytho   style   shuf   span   random   

 

import random  
  
nums = [1, 2, 3, 4, 5, 6, 7]  
random.shuffle(nums)  
print(nums)

 

python 将一个列表乱序

标签:port   class   color   rand   pytho   style   shuf   span   random   

原文地址:https://www.cnblogs.com/sea-stream/p/9966077.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!