Q:

Write a Python program to calculate the product of the unique numbers of a given list

0

Write a Python program to calculate the product of the unique numbers of a given list.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

def unique_product(list_data):
    temp = list(set(list_data))
    p = 1
    for i in temp:
        p *= i
    return p
nums = [10, 20, 30, 40, 20, 50, 60, 40]
print("Original List : ",nums)
print("Product of the unique numbers of the said list: ",unique_product(nums))

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now