13. product


#1
def product(old_list):
   total = 1
   for each in old_list:
       total = total * each
       split = old_list.split()
       if (each == split):
           return split
   return total

please help out with this... thanks!!!


#2

What is the split list for?

def product(old_list):
    total = 1
    for each in old_list:
       total = total * each
    return total

is all that's needed.

It seems like your first indentation level is 3 spaces. It works but you should always use 4 spaces.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.