# Letter from a Prepper – Teaching Math with Python

0
61

So Childish Meteor has known the crude mechanics of Math for a while now.  We bought him some educational videos early on that taught him the Letters, Numbers, Shapes, and Colors and they worked so well that when they expanded their offering we could not resist getting the Math Videos as well.

But now that he is in Kindergarten he is learning and practicing more addition and subtraction for his classes.  He is having to apply what he learned and work out the problems in the assignment.

## Making it a Game

At first, he started out wanting to use a calculator, and once I taught him a little Python he wanted to use scripts to do his homework too.  I wanted to use python to reinforce his learning without having it do it for him.  So, I helped him work out a simple subtraction game to practice his subtraction for school.

```from random import *

print ("Welcome to our Subtraction Game")
score = 0

while score < 100:
x = randint(1, 10)
y = randint(x, 10)

print("What is", x ,"-", y, "?")

correct = (x - y)

score = score + 10
else:
print("The Correct answer is:", correct, "Try again!")
score = score - 10

print("YOU WIN!")```

We modeled the game off an example we found in Hello World!: Computer Programming for Kids and Other Beginners for a number guessing game featuring the Dread Pirate Roberts of Princess Bride fame.

We worked out a way for it to select random numbers and create unique math problems each time using the random module.  We also made it so it keeps score and allows you to win after getting 100 points, adding 10 for each right answer and taking away 10 for each wrong one.

It has been working great in getting him to practice his subtraction problems.   He still wants to use a calculator or write another python script but I make him give me the answer before we “check” his work with either one.  It seems to be an acceptable compromise for now.

How do you get creative with your Math Practice?

Previous articleHow To Be A Successful Homesteader
Next articleLetter from a Prepper – Homeless by Choice
Amy Richardson says that collaborating with The Prepper's Daily is only a logic step in her career. Formally trained in emergency and disaster management response with the American Red Cross, Amy wants to focus on educating the public on topics like natural living, homesteading, homeschooling and family preparedness. Even if she left the Red Cross, her goals remain the same: to prevent and alleviate human suffering wherever it may be found. The purpose of her contribution to the prepper world is to protect life and health and to ensure respect for the human being. As simple as that.