Question: Write a Python program basel.py that modifies Listing on the picture to print a table of values of n E 1/k**2 for n = 10
Write a Python program basel.py that modifies Listing on the picture to print a table of values of n E 1/k**2 for n = 10 , 100 , 1000...10**7

k=1
E depicts sigma
Use the program to conjecture what happens when the sum becomes large
Use range ( ) to create the exponents
In addition to the sum, also print the sqaure root of six times the sum
Listing 4.1: Harmonic Sum harmonic. py def harmonic (n): 3 # Compute the sum of 1/k for k=1 to n. total = for k in range (1, n + 1): total += 1 / k def main(): 10 n int (input ('Enter a positive integer: 9) print ("The sum of 1/k for k = 1 to", n, "is", harmonic(n)) Es
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
