Android & iPhone apps are coming soon. Log in for a plan and reminders made for you →

Coding basics · 6 of 20

Multiplication table

Return the first ten multiples of n as a list: [n×1, n×2, …, n×10].

What you need

A list holds values in order. Start with an empty list [] and add to the end with append.

evens = []
for i in range(1, 4):
    evens.append(i * 2)
# evens is now [2, 4, 6]

Examples

Input n = 3

Output [3, 6, 9, 12, 15, 18, 21, 24, 27, 30]

Input n = 0

Output [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

Your code · Python

Stuck?