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 yield a keyword in python?
So, what is an iterator, then?
Tell us what is python? What are the benefits of using python?
Which is more powerful python or c++?
does recursion cause any trouble?
How do you sort a list alphabetically in python with sort function?
What is setup py in python?
What are negative indices?
What is file context manager?
What is instance method?
Is r language hard?
What is the difference between 'is' and '==' in python?
Does the functions help() and dir() list the names of all the built_in functions and variables? If no, how would you list them?
Which databases are supported by python?
Why python is popular nowadays?