+ 1

How do you add spaces between words output in python?

everything i've seen shows adding whitespaces

26th Nov 2021, 8:48 PM
Keefer
Keefer - avatar
3 Respuestas
+ 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
26th Nov 2021, 9:07 PM
Lothar
Lothar - avatar
+ 5
Try this: name=input() print("Hello "+name) print("Hello",name) print(f'Hello {name}')
26th Nov 2021, 9:08 PM
Abdulaziz Al-Shehhi
Abdulaziz Al-Shehhi - avatar