+ 1

Making a normal string into a raw one

Can I convert a normal string (name it my_str) into a raw one as follows raw = r"" for letter in my_str: raw += letter

9th Mar 2019, 9:33 PM
ć€š“Ŗš“ˆš’½š““š“Ŗā„•ā™¦ā„š“Ŗš“·š’æš“«š“Ŗš“‡ć€‘
ć€š“Ŗš“ˆš’½š““š“Ŗā„•ā™¦ā„š“Ŗš“·š’æš“«š“Ŗš“‡ć€‘ - avatar
1 Answer
+ 3
Ashkan Ranjbar You don't need to convert a normal string into a raw one or vice versa, as the normal string and the raw string are not data types. A raw string is only a convenient way of typing a string. The code below makes these things clearer. As you can see r"some text" and "some text" are the same string objects https://code.sololearn.com/cir9St39oh2x/?ref=app
9th Mar 2019, 11:02 PM
portpass