String formatting [Py] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

String formatting [Py]

I want to use this code: print("{:^20}".format("Welcome")) Out: " Welcome " but I want an output like this: "------Welcome------" I mean, replacing the blank spaces with another symbol. Can you help me?

19th Jun 2018, 6:54 PM
Jp Reyes
Jp Reyes - avatar
1 Answer
0
Ty <3
19th Jun 2018, 7:54 PM
Jp Reyes
Jp Reyes - avatar