pythoncodacy

Not enough arguments for format string python


On codacy it detects an issue where I dont have enough arguments for format string. Help please.

code:

self.notify.error("An item we don't have: track %s level %s was selected." % [track, level]) 

Solution

  • pass a tuple, not a list

    self.notify.error("An item we don't have: track %s level %s was selected." % (track, level))