對 Python 來說還是新手,所以我很抱歉.. 我正在嘗試將串列列印成字母塊。特別是7,但我不確定如何洗掉逗號和行。
我目前擁有的
for index in range(0, len(populatedList), 7) :
print (populatedList[index:index 7])
我想得到什么
uj5u.com熱心網友回復:
以下應該作業:
for index in range(0, len(populatedList), 7) :
print ("".join(populatedList[index:index 7]))
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/490264.html
下一篇:跨串列取平均值
