Write a python program to compute cumulative product of a list of numbers (write function cumulative_product).

 def cummulative_product(n):

    l=[]

    product=1

    print("Read The List Of Elements Upto:",n)

    for i in range(n):

        ele=int(input())

        l.append(ele)

    for i in l:

        product=product*i

    return product

n=int(input("Enter Size Of List:"))

print("The Cummulative Product Of The List is:",cummulative_product(n))

              


Comments

Popular posts from this blog

Write a Python program to compute distance between two points taking input from the user. Formula for Pythagorean theorem for compute distance between two points is: