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
Is python better than bash?
What are the benefits of flask?
How is print statement represented in python 3 (v/s python2)?
How do you make 3d plots/visualizations using numpy/scipy?
What is the use of metaclass in python?
Is c++ required for learning python?
What is the purpose of the pythonstartup environment variable?
What are built in types in python?
Which is faster python or php?
How to pass optional or keyword parameters from one function to another in python?
What does len () do in python?
does recursion cause any trouble?
How to find max length of any given sublist?
Which is better c++ or java or python?
Does the same python code work on multiple platforms without any changes?