+ 1

How do you insert a letter to the first place in a string without deleting the old one? In python

I had comleted the python tutorial a long time ago and I can't find the anser to this question in the Sololearn tutorial.

14th Jan 2020, 2:20 PM
Toni Kousek
Toni Kousek - avatar
2 Answers
+ 1
Thanks Alexandr it helped me a lot
14th Jan 2020, 2:32 PM
Toni Kousek
Toni Kousek - avatar
+ 1
Just using simple String Concatenation Like this text = "sample text" text = "text you want to add" + text And if you just want to print it you can just separate them in a print statement like this print('text you want to add',text) And Print function automatically adds a space between them. But remember don't try to add a string with a integer or a float using concatenation ,or you will get an error
14th Jan 2020, 2:44 PM
Elliot
Elliot - avatar