docs

a slatepencil documentail site

View on GitHub

Define a procedure multIA(m, n), which returns the product of m and n, assuming that n is a positive integer. Don’t use *; instead, use a while loop, and +. Your function should have type (num, positiveInt) -> num

def multIA(m, n):
    x = 0
    while (n > 0):
        n = n - 1
        x += m
    return x