标签:range app += 分隔符 print pytho load append div
1 a = "to be or not to be" 2 a = a.spilt() 3 print(a) 4 [‘to‘,‘be‘,‘or‘,‘not‘,‘to‘,‘be‘]
1 a = [‘wo‘,‘ai‘,‘ni‘] 2 a = ‘*‘.join(a) 3 print(a) 4 ‘wo*ai*ni‘
1 a = "" 2 import time 3 time01 = time.time() 4 for i in range(10000000): 5 a+= "sxt" 6 time02 = time.time() 7 print("时间:"+str(time02 - time01)) 8 9 time03 = time.time() 10 li = [] 11 for i in range(10000000): 12 li.append("sxt") 13 14 a="".join(li) 15 16 time04 = time.time() 17 print("时间:"+str(time04 - time03))
循环100w次和循环1000w次
标签:range app += 分隔符 print pytho load append div
原文地址:https://www.cnblogs.com/xujie-0528/p/13620228.html