+ 1
How do you add spaces between words output in python?
everything i've seen shows adding whitespaces
3 Antworten
+ 8
Keefer ,
if you are using variables and strings with the print() function, you can separate them by comma. this inserts a space.
first_name = "Paul"
last_name = " Simon"
print("My name is", first_name, last_name)
result: My name is Paul Simon
+ 5
Try this:
name=input()
print("Hello "+name)
print("Hello",name)
print(f'Hello {name}')
+ 3
Hey! Keefer, there are many ways to do it!!
(1):
https://stackoverflow.com/questions/9969684/how-do-i-add-space-between-two-variables-after-a-print-in-JUMP_LINK__&&__python__&&__JUMP_LINK
(2):
https://stackoverflow.com/questions/35723352/how-do-i-put-a-space-between-two-string-items-in-python/35723392
(3):
https://www.quora.com/How-do-I-print-with-spaces-in-Python
#Searches from Google