+ 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
5 odpowiedzi
+ 1
You're welcome!
+ 5
Hi! Thats right! only between two quotation marks, insert a space inside them.
+ 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.
+ 2
There are, actually, spaces. They are just quite thin )
0
Thanks a lot to Axelocity