We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 84e9378 commit 480338aCopy full SHA for 480338a
1 file changed
maths/series/sum_ofsqauresof_nnaturalnumbers.py
@@ -0,0 +1,11 @@
1
+class squares_natural_numbers:
2
+ def __init__(self, n):
3
+ self.n = n
4
+
5
+ def get(self):
6
+ a = (self.n * (self.n + 1) * (2 * self.n + 1)) / 6
7
+ print("The sum of the squares of the first", self.n, "natural numbers is", a)
8
9
+sol = squares_natural_numbers(2)
10
+sol.get()
11
0 commit comments