Mark Cidade's answer is right - you need to supply a tuple.

However from Python 2.6 onwards you can use format instead of %:

'{0} in {1}'.format(unicode(self.author,'utf-8'),  unicode(self.publication,'utf-8'))

Usage of % for formatting strings is no longer encouraged.

This method of string formatting is the new standard in Python 3.0, and should be preferred to the % formatting described in String Formatting Operations in new code.

Answer from Mark Byers on Stack Overflow
🌐
Delft Stack
delftstack.com › home › howto › python › how to print multiple arguments in python
How to Print Multiple Arguments in Python | Delft Stack
March 11, 2025 - The print() function automatically adds a space between each argument, making it easy to read. Additionally, you can customize the separator using the sep parameter. For example: ... Here, we used sep=", " to change the default space to a comma ...
🌐
Linux Hint
linuxhint.com › python_string_formatting
Python String Formatting – Linux Hint
#!/usr/bin/env python3 # Initialize two string variables employee = "John" profession = "Programmer" # Print the formatted values of the variables print("%s is a %s" % (employee,profession)) ... The output is shown on the right side of the image. This method can take both positional and keyword parameters as arguments. It can read multiple arguments and returns the formatted output of the string data.
🌐
Python
docs.python.org › 3 › library › string.html
Common string operations — Python 3.14.6 documentation
Because arg_name is not quote-delimited, it is not possible to specify arbitrary dictionary keys (e.g., the strings '10' or ':-]') within a format string. The arg_name can be followed by any number of index or attribute expressions. An expression of the form '.name' selects the named attribute using getattr(), while an expression of the form '[index]' does an index lookup using __getitem__(). Changed in version 3.1: The positional argument specifiers can be omitted for str.format(), so '{} {}'.format(a, b) is equivalent to '{0} {1}'.format(a, b).
🌐
Python
peps.python.org › pep-3101
PEP 3101 – Advanced String Formatting | peps.python.org
Each keyword argument is identified by its keyword name, so in the above example, ‘c’ is used to refer to the third argument. There is also a global built-in function, ‘format’ which formats a single value: ... This function is described in a later section. Format strings consist of intermingled character data and markup.
🌐
Real Python
realpython.com › python-formatted-output
A Guide to Modern Python String Formatting Tools – Real Python
February 1, 2025 - You create an f-string in Python by prefixing a string literal with the letter f or F. You can then include variables or expressions inside curly braces ({}) within the f-string. Can you use variables in Python’s .format() method?Show/Hide · Yes, you can use variables as arguments in the .format() method by passing them in order or by naming them and referencing them in the string’s replacement fields.
🌐
TutorialsPoint
tutorialspoint.com › how-to-print-multiple-arguments-in-python
How to Print Multiple Arguments in Python?
August 29, 2023 - F-strings provide the most readable and efficient way to format multiple arguments ? name = "Bob" course = "Python" duration = 6 print(f"Hello {name}, you're enrolled in {course} for {duration} months") print(f"Progress: {85}% complete")
Find elsewhere
🌐
Learn Python
learnpython.org › en › String_Formatting
String Formatting - Learn Python - Free Interactive Python Tutorial
To use two or more argument specifiers, use a tuple (parentheses): # This prints out "John is 23 years old." name = "John" age = 23 print("%s is %d years old." % (name, age)) Any object which is not a string can be formatted using the %s operator ...
🌐
Codecademy Forums
discuss.codecademy.com › frequently asked questions › python faq
How do I insert multiple variables with string formatting? - Python FAQ - Codecademy Forums
June 18, 2018 - Question How do I insert multiple variables with string formatting? Answer So long as your number of %s placeholders matches the number of variables you are providing after the %, it will insert them in the order in which you provide them.
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-use-string-formatters-in-python-3
How To Use String Formatters in Python 3 | DigitalOcean
August 20, 2021 - We then passed 4 values into the str.format() method, mixing string and integer data types. Each of these values are separated by a comma. ##Reordering Formatters with Positional and Keyword Arguments · When we leave curly braces empty without any parameters, Python will replace the values ...
🌐
py4u
py4u.org › blog › python-string-formatting-reference-one-argument-multiple-times
Python String Formatting: How to Reference One Argument Multiple Times with Replacement Tokens
In this blog, we’ll explore **four key string formatting methods** in Python and demonstrate how to reference a single argument multiple times using each. We’ll cover old-style `%-formatting`, the `str.format()` method, modern f-strings, and template strings, comparing their syntax, use ...
🌐
Medium
medium.com › @RohitPatil18 › string-formatting-in-python-d287c0bcac9e
String Formatting in Python. When I first started programming, I… | by Rohit Patil | Medium
January 2, 2022 - Another way to format a string is to use .format method. Similar to previous method we seen, we have to use placeholder where we want variables values except we don’t have to use type matching placeholder rather there are different ways in which we can use placeholders. ... Let’s have a look at them one by one. ... In given example, I am basically passing positional arguments to the format function.
🌐
PyFormat
pyformat.info
PyFormat: Using % and .format() for great good!
Further details about these two formatting methods can be found in the official Python documentation: ... If you want to contribute more examples, feel free to create a pull-request on Github! ... Simple positional formatting is probably the most common use-case. Use it if the order of your arguments is not likely to change and you only have very few elements you want to concatenate.
🌐
GeeksforGeeks
geeksforgeeks.org › python-string-format-method
Python String format() Method - GeeksforGeeks
March 26, 2025 - Hangup (SIGHUP) Traceback (most recent call last): File "/home/guest/sandbox/Solution.py", line 2, in <module> print(s.format("GeeksforGeeks", "computer", "geeks")) # Missing one argument ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ IndexError: Replacement index 3 out of range for positional args tuple · We can use escape sequences to format strings in a more readable way. Escape sequences allow us to insert special characters such as newline \n, tab \t, or quotes. In Python, {} placeholders in str.format() are replaced sequentially by default.
🌐
Pythonhow
pythonhow.com › video-course › beginner › string-formatting-with-multiple-variables
String formatting with multiple variables
This video covers string formatting with multiple variables. After watching this video, you will learn how to dynamically insert more than one value inside a string. Next Video · Python Mega Course: Learn Python in 60 Days, Build 20 Apps Learn Python on Udemy completely in 60 days or less ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-print-multiple-arguments-in-python
How to Print Multiple Arguments in Python? - GeeksforGeeks
July 23, 2025 - ... f-strings allow embedding expressions inside string literals using {}. They provide a concise and readable way to format strings dynamically. ... *args parameter allows passing multiple arguments dynamically and the function processes them ...