Marco Sulla
Marco Sulla

Reputation: 15930

Raw strings and repr() are equivalent?

In Python, you can define a literal string as a raw string. Surfing on internet, I read that it is equivalent to repr(). More exactly, I tested that:

r"mystring" == repr("mystring")[1:-1]

Is this always true?

EDIT: the linked question does not answer my question, since it's about difference between raw strings and unicode strings, not raw strings and repr().

Upvotes: 0

Views: 267

Answers (0)

Related Questions