write a program in python to derive lebnitz equation of pi v

write a program in python to derive lebnitz equation of pi value for n=12

and also write a code to calculate radius..circumference...area..of the circle

one method is in class and other method is to declare the class

Solution

Program:

imort math

class AreaofCircle()

def Circle()

radius = int(input(\'enter radius of circle:\"))

def Circum(radiaus):

result = 2 * pi * radius

print(\'the circumference of circle os{0:.00f}\'.format(result))

def area(radius):

result = pi * raduis * radius

print(\'the area of the circle is{0:.002f}\'.format(result))

AreaofCircle()

Lebnitz derivation program:

n=12

print 4 * sum((-1). **k / (2*k + 1) for k xrange of (n))

print math.pi

write a program in python to derive lebnitz equation of pi value for n=12 and also write a code to calculate radius..circumference...area..of the circle one met

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site