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 difference between input and raw_input?

946


What are python decorators? 8) What is the difference ...

855


What does a continue statement do in python?

899


Which module(s) of python can be used to measure the performance of your application code?

828


How to count the occurrences of a list item?

813


What are the principal differences between the lambda and def?

878


Can you hack with python?

805


Is python object oriented?

801


How do you run a python script?

883


Write code to print everything in the string except the spaces.

793


Is html harder than python?

824


Can python be used for web client and web server side programming?

778


In python, how do copy a file?

858


What is decorators?

785


Does python have null?

761