>>> print "-- %2$s -- %1$s --" % ('a', 'b') Python isn't C you know! You can't simply copy things from C to Python and expect them to work. Take a look at... http://www.python.org/doc/current/lib/typesseq-strings.html And you'll see that what you actually want is just... >>> print "-- %s -- %s --" % ('a', 'b') HTH, Andrew