Think before you speak, read before you think.

python打印list为空格间隔的一行

my_list = [2193, 2192, 2191, 2204, 2203, 2202, 2201, 2200, 2199, 2197]
print(" ".join(str(x) for x in my_list))

输出结果

2193 2192 2191 2204 2203 2202 2201 2200 2199 2197

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *