Skip to content

How to Print Multiple Arguments in Python

If you need to print out multiple arguments using Python, then you can do one of the following:

Option 1 – Using print

print("Something", "Else", "Please")
Code language: Python (python)

Output: Something Else Please

Option 2 – Using String Formatting

print("Something {} {}".format("Else", "Please"))
Code language: Python (python)

Output: Something Else Please

Or with explicit ordering:

print("Something {1} {0}".format("Else", "Please"))
Code language: Python (python)

Output: Something Please Else

Option 3 – Using F-String Formatting

one = "Something" two = "Else" three = "Please" print(f"{one} {two} {three}")
Code language: Python (python)

Output: Something Else Please

See also  How to Raise a Number to a Power in Golang
Tags:
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x