"%s=%s" % (k, v)
whole expression evaluates to a string. The first %s is replaced by the value of k; the second %s is replaced by the value of v. All other characters in the string (in this case, the equal sign) stay as they are.
String formatting works with integers by specifying %d instead of %s
Unlike string formatting, string concatenation works only when everything is already a string.
Formatting Numbers
print "Today's stock price: %f" % 50.4625
print "Today's stock price: %.2f" % 50.4625
print "Change since yesterday: %+.2f" % 1.5
Reference: