Input and Output: repr(): generate representations which can be read by the interpreter : repr « Buildin Function « Python






Input and Output: repr(): generate representations which can be read by the interpreter

Input and Output: repr(): generate representations which can be read by the interpreter

#For objects which don't have a particular representation for human consumption, 
#str() will return the same value as repr(). 


s = 'Hello, world.'

print repr(s)

           
       








Related examples in the same category

1.Used by echoes: as code formUsed by echoes: as code form
2.str() and repr(): Strings and floating point numbers, have two distinct representations.str() and repr(): Strings and floating point numbers, have two distinct representations.
3.The repr() of a string adds string quotes and backslashesThe repr() of a string adds string quotes and backslashes
4.Here are two ways to write a table of squares and cubes
5.Output Formatting: reprOutput Formatting: repr