w3resource
w3resource logo

Python: repr() function

(追記) (追記ここまで)
(追記) (追記ここまで)

repr() function

The repr() function returns a string containing a printable representation of an object.

Version:

(Python 3.2.5)

Syntax:

repr(object)

Parameter:

Name Description Required /
Optional
object An object. Required

Return value:

A printable representational string of the given object.

Example: Python repr() function

class Example:
 name = 'Bishop'
 def __repr__(self):
 return repr(self.name)
print(repr(Example()))

Output:

'Bishop'

Python Code Editor:

[フレーム]

PREV : range()
NEXT : reversed()

Test your Python skills with w3resource's quiz



Follow us on Facebook and Twitter for latest update.

(追記) (追記ここまで)


(追記) (追記ここまで)
(追記) (追記ここまで)


AltStyle によって変換されたページ (->オリジナル) /