Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between `__str__` and `__repr__` methods in Python?

Answer Posted / nashiinformaticssolutions

`__str__` is used for creating a user-friendly string representation of an object. `__repr__` is used for creating a detailed string representation of an object, intended for debugging.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how do I protect python code?

916


What is python method?

853


What is pytest?

853


What is set when we have to use?

893


What are the components of python memory manager?

883


Why do lambda forms in python not have the statements?

1030


How will you remove an object from a list?

874


Where do you use python programming? Can you describe in detail?

838


How do you sort a list in python?

841


Do you know how python is interpreted?

977


What is purpose of __init__ in class ? Is it necessary to use __init__ while creating a class ?

874


What is loop and types?

855


What is pip command in python?

839


In oops what is a diamond problem in inheritance?

875


Should I learn python before c?

865