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 |
What do you understand by python iterator and iterable elements?
Do you know what the difference between lists and tuples is? Can you give
Explain the use of // operator in python?
Do lists start at 0 or 1 java?
Explain how to create a multidimensional list.
How do you copy an object in python?
What exactly are pandas?
When you need ordered container of things, which will be manipulated, use lists?
What packages in the standard library, useful for data science work, do you know?
Which the command you use to exit help window in python?
What is python used for?
What is the purpose of is, not and in operators?