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 to get all keys from dictionary ?

928


Do you know what is the key difference between a list and the tuple?

941


What is the difference between args and kwargs?

881


What is yaml file in python?

924


Find all occurrences of a substring in Python

1029


What are the best sites to learn python?

992


What is map function in python?

1061


What is python unit test?

982


Since switch-case is not used in python – what are the replacements for switch statement in python?

934


Can you run python programs without python installed?

940


How is fail over mechanism works in python?

1002


Can python be used for web client and web server side programming? And which one is best suited to python?

879


Is java or python more useful?

885


How do I make python scripts executable?

1068


How would you randomize the contents of a list in-place?

908