Computer Science, asked by yousafkhan, 5 months ago

How Write a program to run the series.
1/2^2+1/3^2+1/4^2+.....+1/n^2?​

Answers

Answered by allysia
0

Answer:

A python code for this goes like:

\tt n = int(inpu t("Enter \ the \ number \ : \ "))\\\tt sum =0 \\\tt for \ i \ in \ range(2, \ n+2):\\\tt{\qquad sum += 1/(n**2)} \\\tt print \ ( sum )

Answered by jai696
0

\large\mathsf\color{pink}{Solution\: using\: python\: 3}

n = int(input("enter n: "))

series = [1 / (x ** 2) for x in range(2, n + 1)]

print(f"{sum(series):.2f}")

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions