Fhernd icon

r801_cambiar_representacion.py

Fhernd | PRO | 12/02/18 04:33:10 PM UTC | 0 ⭐ | 3402 👁️ | Never ⏰ | []
Python |

280 B

|

None

|

0 👍

/

0 👎

class Par:
    def __init__(self, x:int, y:int):
        self.x = x
        self.y = y
 
    def __repr__(self):
        return 'Par({0.x!r}, {0.y!r})'.format(self)
 
    def __str__(self):
        return '({0.x!s}, {0.y!s})'.format(self)
 
par = Par(2, 3)
 
par
 
print(par)

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎