Basics

Module 2 · Basics · Lesson 6 of 9

Using multiple arguments

print isn't limited to one argument. Separate several values with commas and it prints them all, left to right, on the same line — slipping a single space between each one automatically.

Many values, one print
print("Python", "is", "fun")
Python·is·fun
the · marks the space print adds between values

This is genuinely useful: you can mix different kinds of value in one call — text and numbers together — without joining them yourself. Python prints each argument in turn and adds the spaces for you.

That automatic space is print's default behaviour, and the next lessons show how to control it. First though — have a play. Add a value, remove one, mix in a number:

Run it yourselfruns in your browser · Python
main.py