Output formatting in Python: replacing several %s with the same variable
Use a dictionary instead. var=”%(foo)s %(foo)s %(foo)s” % { ‘foo’: ‘look_at_me_three_times’ } Or format with explicit numbering. var=”{0} {0} {0}”.format(‘look_at_meeee’) Well, or format with named parameters. var=”{foo} {foo} {foo}”.format(foo = ‘python you so crazy’)