본문 바로가기
Python

random

by SpeeDr00t 2016. 7. 21.
반응형

random

1. 소스

import random 
print "%2d" % ( random.randrange( 1, 8 ) )
                                        

결과

hacker@ubuntu:~/python$ python random1.py 
 7
                                    
반응형

'Python' 카테고리의 다른 글

import ( from )  (0) 2016.07.21
dir  (0) 2016.07.21
python for  (0) 2016.07.21
python while 문  (0) 2016.07.21
if 문  (0) 2016.07.21