Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

In Problem, find f(x) and simplify. f(x) = (4x + 3)1/2

Answered: 1 week ago

Question

=+3. Identify and define the three key aspects of job training.

Answered: 1 week ago

Question

=+ (b) Show that X' and Y' are dependent but uncorrelated.

Answered: 1 week ago