将一个字符串打印出(行数==个数) a = 'asdfghjkldsadasd' hs = 1 gs = 0 i = 0 while(i<len(a)): if hs==gs: print() gs=0 hs += 1 gs+=1 print(a[i],end='') i+=1