我做错了什么才能得到这个错误?
replacements = {}
replacements["**"] = ("<strong>", "</strong>")
replacements["__"] = ("<em>", "</em>")
replacements["--"] = ("<blink>", "</blink>")
replacements["=="] = ("<marquee>", "</marquee>")
replacements["@@"] = ("<code>", "</code>")
for delimiter, (open_tag, close_tag) in replacements: # error here
message = self.replaceFormatting(delimiter, message, open_tag, close_tag);
错误:
回溯(最近一次呼叫时间):
文件“”,第1行,在
对于doot,(a,b)in replacements:ValueError:需要超过1个值
打开
所有的值元组都有两个值。对吗?
最佳答案
应该是:
for delimiter, (open_tag, close_tag) in replacements.iteritems(): # or .items() in py3k