+ 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 Resposta
+ 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