码迷,mamicode.com
首页 > 其他好文 > 详细

生成5位随机数

时间:2018-11-01 16:09:24      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:col   def   int   rand   style   pre   add   +=   range   

 1 import random
 2 
 3 def v_code():
 4     code=""
 5     for i in range(5):
 6         add_num = random.randrange(10)
 7         code +=str(add_num)
 8 
 9     print(code)
10 
11 v_code()

 

生成5位随机数

标签:col   def   int   rand   style   pre   add   +=   range   

原文地址:https://www.cnblogs.com/xaiobong/p/9889483.html

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