script.py
= "Hello"
greeting = "Matt"
name
print(greeting, name)
The variables first_phrase
and second_phrase
are almost unchanged. The only difference is that first_phrase
no longer has the extra space at the end of it.
We pass these two variables as two arguments to print()
, separating them by commas. print()
will automatically add spaces between each argument when displaying the output.
script.py
= "Hello"
greeting = "Matt"
name
print(greeting, name)
Once more, when we run our code, the output has not changed, as expected:
Terminal/Command Prompt
run script.py
Hello Matt