Solución
solution.tsTypeScript
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def __repr__(self) -> str:
# Retorna la representación técnica del punto
return f"Point({self.x}, {self.y})"
def __str__(self) -> str:
# Retorna la representación amigable del punto
return f"({self.x}, {self.y})"
def describe_point(x, y):
p = Point(x, y)
return {"repr": repr(p), "str": str(p)}0respuestas