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 is difference between input and raw_input?
What are python decorators? 8) What is the difference ...
What does a continue statement do in python?
Which module(s) of python can be used to measure the performance of your application code?
How to count the occurrences of a list item?
What are the principal differences between the lambda and def?
Can you hack with python?
Is python object oriented?
How do you run a python script?
Write code to print everything in the string except the spaces.
Is html harder than python?
Can python be used for web client and web server side programming?
In python, how do copy a file?
What is decorators?
Does python have null?