W3docs

Print multiple arguments in Python

Here is an example of how to print multiple arguments in Python:

Here is an example of how to print multiple arguments in Python:

Print multiple arguments in Python

# Using the print function with multiple arguments separated by a comma
print("Hello,", "world!")

# Using the format method
print("Hello, {}!".format("world"))

<div class="alert alert-info flex not-prose"> Watch a course <span class="hidden md:block">Watch a video course </span> Python - The Practical Guide</div>

Both of the above code snippets will output:


Hello, world!

You can also use f-strings (formatted string literals) which were introduced in Python 3.6:

Use f-strings in print in Python

# Using f-strings
print(f"Hello, {'world'}!")

This will also output the same output as above.