The problem is probably best understood by breaking down how these formatting directives work. The basic idea is that each %
in a string means an argument needs to be subsequently supplied to the string.
For instance, this would work:
title = "i'm %s with %s" % ('programming', 'python')
and yield
"i'm programming with python"
The 's' in %s
means that this is a place holder for a string. A 'd' would be for integers, 'f' for floats etc. There are also additional parameters you can specify. See these docs.
If you don't supply enough items for each place holder, it will result in the not enough arguments for format string
message.
Your specific example first creates a string constant that has two formatting directives in it. Then when you use it, you'll have to supply two items for it.
In other words,
title = "i'm %s with %s"
title % ('programming', 'python')
becomes
"i'm %s with %s" % ('programming', 'python')