AI Features

Solution Review 1: Square Numbers and Return Their Sum

This lesson provides a solution review for the 'Square Numbers and Return Their Sum' challenge.

We'll cover the following...

Solution

Python 3.5
class Point:
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
def sqSum(self):
a = self.x * self.x
b = self.y * self.y
c = self.z * self.z
return(a + b + c)
obj1 = Point(4, 5, 6)
print(obj1.sqSum())
...