0
How to properly add space in printed statements
I get WelcomeAmy instead of Welcome Amy
3 Answers
+ 4
When separated by commas, the parameter "sep" is whitespace by default
print("Welcome", "Amy")
>> Welcome Amy
- - - - - - - - - - - - - -
Note that here, there is a whitespace after the word Welcome, because concatenating strings don't add whitespaces in between.
print("Welcome " + "Amy")
>> Welcome Amy
+ 3
print takes arguments of the string to be outputed like:
print("Welcome","Amy") this will result in "Welcome Amy"
if you do "Welcome"+"Amy" it would result in "WelcomeAmy"
+ 1
Thank you all. The way I worded the question wasn't quite correct but useful nonetheless. ("Welcome", name) gave the correct output.