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

What is jinja python?

1000


How do I debug an extension?

1046


Is python faster than python2?

912


What is pip?

1258


What is pip software in the python world?

937


What is pickling and unpickling in python?

960


What is the meaning of a single- and a double-underscore before an object name?

1001


How can you dynamically create variables in python via a while loop?

970


Python ­ How to create a multidimensional list?

1100


What is dictionary in python?

964


What is pyunit in python?

853


What is try block?

925


How do I run a python script?

1042


Specify the differences between pyramid, django, and flask.

967


What are the built-in types of python?

929