Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
11 changes: 11 additions & 0 deletions maths/series/sum_ofsqauresof_nnaturalnumbers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class squares_natural_numbers:

Check failure on line 1 in maths/series/sum_ofsqauresof_nnaturalnumbers.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (N801)

maths/series/sum_ofsqauresof_nnaturalnumbers.py:1:7: N801 Class name `squares_natural_numbers` should use CapWords convention
def __init__(self, n):
self.n = n

def get(self):
a = (self.n * (self.n + 1) * (2 * self.n + 1)) / 6
print("The sum of the squares of the first", self.n, "natural numbers is", a)


sol = squares_natural_numbers(2)
sol.get()
Loading