OsahonE

Wk4_5

Mar 31st, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. def product(list):
  2.     product = 1
  3.     '''iterating over each number in list, we
  4.     have:'''
  5.     for number in list:
  6.         product *= number
  7.         #product = product * number
  8.     return product
  9.  
  10. print(product([3, 5, 7, 9, 12]))
  11. print(product([30, 40, 50, 60]))
  12. print(product([3])
Advertisement
Add Comment
Please, Sign In to add comment