In Python this will be like so:
from dataclasses import dataclass # Python >= 3.7
@dataclass
class Point2D:
x: float
y: float
def sumPoints(p1: Point2D, p2: Point2D) -> Point2D:
x = p1.x + p2.x
y = p2.y + p2.y
return Point2D(x, y)
print(sumPoints(Point2D(1.0, 2.0), Point2D(3.0, 4.0)))
Run
- Is there more simple way to solve this task? Orlean
- Is there more simple way to solve this task? Araq
- Is there more simple way to solve this task? Orlean
- Is there more simple way to solve this task? geekrelief
- Is there more simple way to solve this ta... Orlean
- Is there more simple way to solve th... jorjun_arch
- Is there more simple way to solv... alexeypetrushin
