+ 1

Space in variable

How would i keep space on my program a = "please" b = "help" c = "me" print(a + b + c) ----output---- pleasehelpme How would i keep space between those variable

14th Mar 2020, 5:06 AM
Fakea Vangchhia
Fakea Vangchhia - avatar
5 odpowiedzi
+ 1
You're welcome!
14th Mar 2020, 7:15 AM
Axelocity
Axelocity - avatar
+ 5
Hi! Thats right! only between two quotation marks, insert a space inside them.
14th Mar 2020, 5:30 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 3
If it's python, than you may either separate the names of the variables with commas: print(a, b, c) or, if you prefer to explicitly concatenate strings: print(a + ' ' + b + ' ' + c) The combination of both methods would also work: print(a + ' ' + b, c) print(a, b + ' ' + c) P.S. Despite there are two spaces inside quotation marks now, there should be one inside each pair. The additional one is added for better visualization.
14th Mar 2020, 5:25 AM
Axelocity
Axelocity - avatar
+ 2
There are, actually, spaces. They are just quite thin )
14th Mar 2020, 5:35 AM
Axelocity
Axelocity - avatar
0
Thanks a lot to Axelocity
14th Mar 2020, 6:54 AM
Fakea Vangchhia
Fakea Vangchhia - avatar