0
Spacing between addition of string variables in Python
Please! I need help here. How can I add spacing to a sample code like this?: firstname = str(input ()) lastname = str(input ()) print (firstname + lastname) For the sample Python code I wrote above, how can I have my output in (firstname lastname), and not (firstnamelastname)?
5 Respostas
+ 5
print(firstname + " " + lastname)
or
print(firstname, lastname)
+ 4
Use , instead of + and it will add spaces between them.
+ 4
Simon Sauter ty ! But i don't care for the downvotes as long as the op finds my answer helpful .
+ 1
Abhay Simon Sauter Thanks for the help, bosses! I can proceed with the code here ☺️
0
Why would anyone down vote Abhay ''s answer? It's absolutely correct.