educative.io

Educative

Alternative Solution: Python Object-Oriented Programming Challenge - Square and Sum Numbers

class Point:
    def __init__(self,x,y,z):
        self.x = x
        self.y = y
        self.z = z

    def sqSum(self):
        self.x **= 2 
        self.y **= 2
        self.z **= 2
        return self.x + self.y + self.z

Resources: https://www.educative.io/module/lesson/learn-oop-in-python/N7LPMRRJ8Z8

Yes. That’s a valid alternative solution.