Question: what is the difference between str and repr in python?
Answer: Both str() and repr() methods in python are used for string representation of a string. ... Now if you go by the official python documentation – the __str__ is used to find the “informal”(readable) string representation of an object whereas __repr__ is used to find the “official” string representation of an object.