runnig

compute array product

Oct 11th, 2017
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. def arrayProduct(arr):
  2.     s = 1
  3.     for a in arr:
  4.         s ?? a   # REPLACE ??
  5.     return s
  6.  
  7. if __name__ == "__main__":
  8.     arr = [1,2,3,4,5]
  9.     x = arrayProduct(arr)
  10.     assert arrayProduct(arr) == 120, ("product of array %s must be 120" % arr)
Advertisement
Add Comment
Please, Sign In to add comment