import time
for i in range(0,101,2):
time.sleep(0.2)
char_num=i//2
per_str=('\r%s%%:%s\n' %(i,'*'* char_num) if i==100 else '\r%s%%:%s' %(i,'*'*char_num))#三元判断
print(per_str,end='',flush=True)
转载于:https://www.cnblogs.com/sihong/p/11075947.html
import time
for i in range(0,101,2):
time.sleep(0.2)
char_num=i//2
per_str=('\r%s%%:%s\n' %(i,'*'* char_num) if i==100 else '\r%s%%:%s' %(i,'*'*char_num))#三元判断
print(per_str,end='',flush=True)
转载于:https://www.cnblogs.com/sihong/p/11075947.html