【发布时间】:2013-01-17 13:46:52
【问题描述】:
words = ['John', 'nice', 'skateboarding']
statement = "%s you are so %s at %s" % w for w in words
产生
File "<stdin>", line 1
statement = "%s you are so %s at %s" % w for w in words
^
SyntaxError: invalid syntax
我在这里做错了什么?假设是:len(words) == 语句中“%s”的数量
【问题讨论】:
标签: python string list string-formatting