标签:def gif view class while show bsp close dex
l=[1,3,5,8,12,34,45,56,67,78,89,123,234,345,456,566,789] def find(find_num,l): print(l) if len(l)==0: print(‘not find‘) return mid_index=len(l)//2 if find_num>l[mid_index]: l=l[mid_index+1:] find(find_num,l) elif find_num<l[mid_index]: l=l[:mid_index] find(find_num,l) else: print(‘find it‘) find(45,l)
1 def grogress_bar(percent,width): 2 if percent > 1:percent=1 3 show_str=(‘%%-%ds‘ %width) %(int(percent * width) *‘#‘) 4 print(‘\r%s%% %s‘ %(int(percent*100),show_str),end=‘‘) 5 6 total_size=123451 7 recv_size=0 8 while total_size > recv_size: 9 time.sleep(0.2) 10 recv_size+=1024 11 percent=recv_size/total_size 12 grogress_bar(percent,width=40)
def hatted_code(n): res=‘‘ for i in range(n): num=str(random.randint(0,9)) alp=chr(random.randint(65,90)) res+=random.choice([num,alp]) return res print(hatted_code(4))
标签:def gif view class while show bsp close dex
原文地址:https://www.cnblogs.com/rongge95500/p/9238921.html