Generate Multiples

Beginner

Let's help you master the art of loops and multipliers! Your task is to create a function that takes two integers: n and m, and returns a list containing the first m multiples of n. This exercise will help you get familiar with using loops and list manipulations in Python.

Here's how it works:

  • If n is 3 and m is 5, then the first 5 multiples of 3 are: 3, 6, 9, 12, and 15.
  • If n is 2 and m is 4, then the first 4 multiples of 2 are: 2, 4, 6, and 8.

Examples:

multiples_of_number(3, 5) # Output: [3, 6, 9, 12, 15] multiples_of_number(2, 4) # Output: [2, 4, 6, 8]

Have fun generating numbers and exploring what the world of Python holds for you!

Geek
Inputs

Arg 1:

3

Arg 2:

5
Expected Output
[3, 6, 9, 12, 15]
Actual Output
Generate Multiples [beginner] | Coding for Kids