At Westonci.ca, we connect you with experts who provide detailed answers to your most pressing questions. Start exploring now! Get immediate answers to your questions from a wide network of experienced professionals on our Q&A platform. Join our Q&A platform to connect with experts dedicated to providing accurate answers to your questions in various fields.

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?