Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6
Here is how you would put it right in the center. p = "pyt hon"
3rd Jan 2022, 12:29 AM
Brian
Brian - avatar
+ 3
My answer was a bit cheeky. Olatomide Akintomide we will need more description from you. What kind of space - tab, space, or blank line? Please give a clear example of your intended result, and share any code where you are having trouble doing it.
3rd Jan 2022, 12:37 AM
Brian
Brian - avatar
+ 3
Ah, but wait, there is more. Suppose you use the comma approach to have print insert spaces for you. You can also tell print to insert a custom string instead of space by using sep= to change the separator. For example, you can change it to "::". print("***",text,"***",sep="::")
3rd Jan 2022, 12:59 AM
Brian
Brian - avatar
+ 1
I think that text: input() should be text = input() To add spaces you could insert them in the "***" strings like this: print("*** "+text+" ***") Alternatively, if you replace the + operators with commas, then Python will print the arguments with a space between them: print("***",text,"***")
3rd Jan 2022, 12:49 AM
Brian
Brian - avatar
0
Space in double or single quotation mark.
3rd Jan 2022, 11:36 AM
N. Vimukthi Dilshan Fernando