Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 codacy 上,它检测到我没有足够的格式字符串参数的问题。请帮忙。
代码:
self.notify.error("An item we don't have: track %s level %s was selected." % [track, level])
传递一个元组,而不是一个列表
self.notify.error("An item we don't have: track %s level %s was selected." % (track, level))
这就是我修复它的方法
"An item we don't have: track {} level {} was selected.".format(track, level)