Q:

python: print numbers like product of two natural numbers

Sorry noob here.
I would like to have a function which, for a given natural number, will printout all possible pairs of 2 natural numbers whose product makes the input.
I think it could be like this, but still can't figured out how to write it properly: 
(the last output line is missing in my code output)
def print_products(n):
    for i in range(1, n):
        if n % i == 0:
            print(n, "=", i, "*", int((n/i)))

And output should be like this:
print(print_products(36))

36 = 1 * 36
36 = 2 * 18
36 = 3 * 12
36 = 4 * 9
36 = 6 * 6
36 = 9 * 4
36 = 12 * 3
36 = 18 * 2
36 = 36 * 1

Thanks for the help and possible explanation

A:

The range() function does not include the end (stop) value so i is never actually n. This is easy to correct with a +1. You should also use integer division (//) as it is neater than passing a float into int().
Making your function:
def print_products(n):
    for i in range(1, n+1):
        if n % i == 0:
            print(n, "=", i, "*", n//i)

and it now works:
36 = 1 * 36
36 = 2 * 18
36 = 3 * 12
36 = 4 * 9
36 = 6 * 6
36 = 9 * 4
36 = 12 * 3
36 = 18 * 2
36 = 36 * 1

We can see from the documentation that range() does not include the stop parameter:

For a positive step, the contents of a range r are determined by the formula r[i] = start + step*i where i >= 0 and r[i] < stop.

The proper terminology is to say that i does not attain the upper bound (stop).

