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
What are the different types of operators in python?
Does python have a switch-case statement?
How to determine the type of instance and inheritance in python?
When should you use generator expressions vs. list comprehensions in Python and viceĀversa?
How do you clear a python shell?
Explain the inheritance in python with an example?
Explain delegation in python
How do I check if python is installed?
How to import a module given the full path?
What are the 5 tuples?
What does the **kwargs do in python?
What is pandas?
How do I generate random numbers in python?
How do you include a string in python?
Explain about python break, continue and pass?