Header Ads Widget

Responsive Advertisement

Write Python Program Calculate Product Multiplying Numbers Given Tuple

 Write Python Program Calculate Product Multiplying Numbers Given Tuple

 

# write a python program to calculate the product multiplying all the numbers of a given tuple.

tuple_length = int(input("Enter tuple length : "))
my_tuple = ()
for x in range(tuple_length):
temp = float(input("Enter tuple item : "))
my_tuple += (temp,)

product = 1
for item in my_tuple:
product = product * item

print("Product of tuple items is : ", product)

 

 

 

Post a Comment

0 Comments