Lesson goal: For loops and making math practice problems

Previous: More for-loop counting | Home | Next: Making math-facts tables

You can use a for loop and the math.random function to make a list of math practice problems. You might want to review how to create random numbers from an earlier lesson.

Now you try. Try constructing a for loop that will count from 1 to 10 or so. Use print to display a math problem that someone could practice with.

Type your code here:


See your results here:

This code is supposed to make multiplcation practice problems, but won't run as-is. Fix the for i=, do line to count through about 10 problems or so (1..10). Next, fix the math.random statements to choose random numbers within the range of numbers you want to have in your problems. Dismiss.
Show a friend, family member, or teacher what you've done!

Here is a share link to your code:

Does your code work? Want to run it on your iPhone?

Here's your code:

  1. Use [Control]-[C] (Windows) or [⌘]-[C] (MacOS) to copy your code.

  2. Paste it using [Control]-[V] (Windows) or [⌘]-[V] (MacOS) into this page

  3. Then click the "Use on iPhone" button that you'll see.