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...

Explain the role of repr function.

Answer Posted / chaitanya

Python can convert any value to a string by making use of two functions repr() or str().

The str() function returns representations of values which are human-readable, while repr() generates representations which can be read by the interpreter.

repr() returns a machine-readable representation of values, suitable for an exec command.

Following code sniipets shows working of repr() & str() :

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is python better than bash?

792


What are the benefits of flask?

903


How is print statement represented in python 3 (v/s python2)?

941


How do you make 3d plots/visualizations using numpy/scipy?

897


What is the use of metaclass in python?

868


Is c++ required for learning python?

773


What is the purpose of the pythonstartup environment variable?

835


What are built in types in python?

969


Which is faster python or php?

845


How to pass optional or keyword parameters from one function to another in python?

890


What does len () do in python?

917


does recursion cause any trouble?

886


How to find max length of any given sublist?

872


Which is better c++ or java or python?

858


Does the same python code work on multiple platforms without any changes?

1069