In this 3 minutes video , you will understand the main difference between the _str_ and the _repr_ built-in Python methods.
Both the str() and repr() functions are used for string representation of a Python object, in Python version 2 you had to use print followed by str or repr, but in Python 3 you can directly use str() or repr().
the _str_ and _repr_ are methods to be used inside a user defined class, while the str() and repr() functions can be used outside classes for conversion purposes.
p.s. : For simplicity, I used function and method interchangeably but to be precise _str_ and _repr_ are ,in fact, methods.
DEV profile : https://dev.to/bekbrace
Github profile: https://github.com/BekBrace
On this page of the site you can watch the video online Easy Syntax in Python : __STR__ Vs __REPR__ Functions with a duration of hours minute second in good quality, which was uploaded by the user Bek Brace 05 October 2020, share the link with friends and acquaintances, this video has already been watched 11,221 times on youtube and it was liked by 222 viewers. Enjoy your viewing!