Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

difference between __str__ and __repr__

>>> import datetime
>>> now = datetime.datetime.now()
>>> now.__str__()
'2020-12-27 22:28:00.324317'
>>> now.__repr__()
'datetime.datetime(2020, 12, 27, 22, 28, 0, 324317)'
Source by www.journaldev.com #
 
PREVIOUS NEXT
Tagged: #difference
ADD COMMENT
Topic
Name
8+6 =