In Python, what is the purpose of the __str__ method in a class? - Study24x7
Social learning Network
19 Feb 2024 11:45 AM study24x7 study24x7

In Python, what is the purpose of the __str__ method in a class?

A

Convert the object to a string representation 

B

Define a string variable

C

Concatenate strings in the class

D

 Print the class definition

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles