Explain the role of repr function.



Explain the role of repr function...

Answer / 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

More Python Interview Questions

Define pyramid in python?

0 Answers  


What is meant by“call by value” in python?

0 Answers  


Tell me the use of the split function in python?

0 Answers  


How useful is python?

0 Answers  


How can I find methods or attributes of an object in Python?

0 Answers  






post me some questions from pythom script

1 Answers   Infosys,


What is the output of this line?

0 Answers  


Is python written in python?

0 Answers  


How can I learn python?

0 Answers  


Is numeric in python?

0 Answers  


What is sphinx python?

0 Answers  


How to capitalize the first letter of each word in a string (python)?

0 Answers  


Categories