【发布时间】:2010-06-02 19:32:34
【问题描述】:
我的 Python 代码:
mapArray = [["#","#","#"],["#","#","#"],["#","#","#"]]
for row in mapArray:
for cell in row:
print cell,
print
print
打印这个:
# # #
# # #
# # #
为什么不这样:
###
###
###
非常感谢!
【问题讨论】:
-
仅供参考,python 文档有一些关于何时决定添加这样的空格的信息。见docs.python.org/reference/simple_stmts.html#print。
标签: python arrays multidimensional-array iteration