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 set iterable python?

961


What is the purpose of not in operator?

1032


Is python scripting easy to learn?

928


Is multiple inheritances possible in python?

981


Tell me how do you debug a program in python?

911


What are the different environment variables identified by python?

891


What is proxy object in python?

1078


How do you sort a dataframe in descending order?

897


Explain accessor and mutator methods in python?

991


What is the difference between 'is' and '==' in python?

1429


What is subclass in python?

1039


Give one example for multiple statements in single statement?

903


With python, how do you find out which directory you are currently in?

933


How long do goats sleep?

903


How do you find the current version of python?

907