
# The multiplication times_table_generator generates a list of the multiples of a particular number, x.
# By default, x = 0.

def times_table_generator(x=0):
    a = []  # Null list collects all multiples after being generated by the for-loop

    n = 0  # Initialises the loop: [n = 0 + x, n = (0 + x) + x, n = (0 + x + x) + x, ...]

    k = 12
    # k simply allows python to loop through the for loop-twelve times to generate twelve multiples:
    # from 0 - 11 (remember Python is zero-based)

    for i in range(k):
        n = n + x
        a.append(n)

    return a

print(times_table_generator(2)) #You can alter the value of k to increase or decrease the number of multiples.
0f5f9dd6cfc082f3d00a4f0457b8cc4413032507
<mask token>

def times_table_generator(x=0):
    a = []
    n = 0
    k = 12
    for i in range(k):
        n = n + x
        a.append(n)
    return a


<mask token>

def times_table_generator(x=0):
    a = []
    n = 0
    k = 12
    for i in range(k):
        n = n + x
        a.append(n)
    return a


print(times_table_generator(2))


# The multiplication times_table_generator generates a list of the multiples of a particular number, x.
# By default, x = 0.

def times_table_generator(x=0):
    a = []  # Null list collects all multiples after being generated by the for-loop

    n = 0  # Initialises the loop: [n = 0 + x, n = (0 + x) + x, n = (0 + x + x) + x, ...]

    k = 12
    # k simply allows python to loop through the for loop-twelve times to generate twelve multiples:
    # from 0 - 11 (remember Python is zero-based)

    for i in range(k):
        n = n + x
        a.append(n)

    return a

print(times_table_generator(2)) #You can alter the value of k to increase or decrease the number of multiples.