0

What is the use of python "repr()" function?

17th Aug 2020, 8:03 AM
Shafayet Arish
Shafayet Arish - avatar
2 Respostas
+ 3
It converts values to strings. The difference to str() is mostly about the meaning. str focuses on how to convert a value into string. repr focuses on how to represent value as a string. Results of str and repr are often very similar, but: -repr is about twice faster than str. -When you use repr for a value, which already is a string, you get extra quotes.
17th Aug 2020, 8:10 AM
Seb TheS
Seb TheS - avatar