我需要帮助 你如何将文字放入3x3网格
这是我到目前为止的代码
var four=new google.maps.LatLng(28.2,-96.0);
答案 0 :(得分:2)
import random
words = ["a", "b", "c", "d", "e", "f", "g", "h", "i"]
random.shuffle(words)
grouped = [words[i:i+3] for i in range(0, len(words), 3)]
for l in grouped:
print "".join("{:<10}".format(x) for x in l)
输出:
e h b
i c g
a d f
如果您需要原始random.shuffle(words)
订单,请删除a,b,c,d,etc
行。