Skip to content

Latest commit

 

History

History
42 lines (25 loc) · 472 Bytes

Beginner_Reduce_but_Grow.md

File metadata and controls

42 lines (25 loc) · 472 Bytes

CodeWars Python Solutions


Beginner - Reduce but Grow

Given a non-empty array of integers, return the result of multiplying the values together in order.

Example:

[1, 2, 3, 4] => 1 * 2 * 3 * 4 = 24

Given Code

def grow(arr):
    pass

Solution

def grow(arr):
    m = 1
    for n in arr:
        m *= n
    return m

See on CodeWars.com