본문으로 바로가기

파이썬(Python) - 응용 예제(time, random)

category 언어/PYTHON 2021. 5. 26. 17:23
728x90
반응형

[          ] 0%

[=         ] 10%

[==        ] 20%

[===       ] 30%

[====      ] 40%

[=====     ] 50%

[======    ] 60%

[=======   ] 70%

[========  ] 80%

[========= ] 90%

[==========] 100%

 

 

import time

import random

 

for p in range(0, 11):

        print("[" + ("="*p) + (" "*(10-p)) + "] " + str(p*10)+"%")

        time.sleep(random.uniform(0.1, 1))

 

참조 : https://www.debugcn.com/ko/article/49818084.html

728x90
반응형