![](/img/trans.png)
[英]Python list | How to remove parenthesis,quotes and commas in my list?
[英]How to remove commas and single quotes from list
我將如何從此列表中刪除單引號和逗號?
coord=[ ['0',' bR ',' bKn ',' bB ',' bQ ',' bK ',' bB ',' bKn ',' bR '],
['1',' bP ',' bP ',' bP ',' bP ',' bP ',' bP ',' bP ',' bP '],
['2',' _ ',' _ ',' _ ',' _ ',' _ ',' _ ',' _ ',' _ '],
['3',' _ ',' _ ',' _ ',' _ ',' _ ',' _ ',' _ ',' _ '],
['4',' _ ',' _ ',' _ ',' _ ',' wK ',' _ ',' _ ',' _ '],
['5',' _ ',' _ ',' _ ',' _ ',' _ ',' _ ',' _ ',' _ '],
['6',' wP ',' _ ',' _ ',' _ ',' _ ',' _ ',' _ ',' _ '],
['7',' wR ',' wKn ',' wB ',' wQ ',' _ ',' wB ',' wKn ',' wR '],
[' ',' 1 ',' 2 ',' 3 ',' 4 ',' 5 ',' 6 ',' 7 ' ,' 8 '] ]
編輯:
根據評論,聽起來您正在尋找:
for x in coord:
print (" ".join(x)+"\n")
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.