Python program

profilesvarsha
Homework1.pdf

Instructions for Homework Assignment 1 The Leibniz formula is a way of calculating the value of pi. Its definition in Wikipedia is:

Write a program in Python that contains a function which calculates pi per the Leibniz formula, based on the number of values passed to it. The rest of the program should

• prompt the user for input,

• call the function, and

• print the value of pi based on the user’s input. (The correct answer is 3.058402765927333 when the user enters 12.)

Be sure to include the standard header block and use comments in your program. Please use your name and “Homework1” as the title of your program, for example SweeneyHomework1.py. Your program must be submitted in Moodle by 9:30 AM on September 15.