How to multiply all items of a list together in Python?
Example-1
def product_list(list_of_numbers): num = 1 for x in list_of_numbers: num = num * x return num thelist = [2, 11, 8] print(product_list(thelist))
176
def product_list(list_of_numbers): num = 1 for x in list_of_numbers: num = num * x return num thelist = [2, 11, 8] print(product_list(thelist))
176