Westonci.ca offers quick and accurate answers to your questions. Join our community and get the insights you need today. Discover detailed answers to your questions from a wide network of experts on our comprehensive Q&A platform. Discover detailed answers to your questions from a wide network of experts on our comprehensive Q&A platform.

In Python, when do we use the str( ) function

Sagot :

Answer:

Both str () and repr () methods in python are used for string representation of a string.

Explanation:

Though they both seem to serve the same purpose, there is a little difference between them. Have you ever noticed what happens when you call a python built-in function str (x) where x is any object you want?