Created
April 18, 2018 20:59
-
-
Save teromakotero/7690720b9153801d14b13859907623c3 to your computer and use it in GitHub Desktop.
Math exercises for first graders: addition exercises, change of order.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| base = [] | |
| remedial = [] | |
| enrichment = [] | |
| kaalit = { | |
| 1:"M1A_07_002.png", | |
| 2:"M1A_07_001.png", | |
| 3:"M1A_02_007.png", | |
| 4:"M1A_02_008.png", | |
| 5:"M1A_02_009.png" | |
| } | |
| varpuset = { | |
| 1:"M1A_02_003.png", | |
| 2:"M1A_02_004.png", | |
| 3:"M1A_02_005.png", | |
| 4:"M1A_02_006.png", | |
| 5:"M1A_12_001.png" | |
| } | |
| porkkanat = { | |
| 1:"M1A_02_024.png", | |
| 2:"M1A_02_023.png", | |
| 3:"M1A_02_022.png", | |
| 4:"M1A_02_021.png", | |
| 5:"M1A_02_010.png" | |
| } | |
| vaihtoehdot = [kaalit,varpuset,porkkanat] | |
| while(len(base) < 10): | |
| num1 = random.randint(1,5) | |
| num2 = random.randint(1,5) | |
| if(num1 + num2 < 6): | |
| string = str(num1) + " + " + str(num2) + " = \n" + str(num2) + " + " + str(num1) + " = " | |
| if(base.count(string) == 0): | |
| base.append(string) | |
| print("") | |
| print("Base:") | |
| print("") | |
| for i in base: | |
| print(i) | |
| print("") | |
| while(len(remedial) < 10): | |
| num1 = random.randint(1,5) | |
| num2 = random.randint(1,5) | |
| kuva = vaihtoehdot[random.randint(0,2)] | |
| if(num1 + num2 < 6): | |
| string = kuva[num1] + " " + kuva[num2] + "\n" + str(num1) + " + " + str(num2) + " = \n" + str(num2) + " + " + str(num1) + " = " | |
| if(remedial.count(string) == 0): | |
| remedial.append(string) | |
| print("") | |
| print("Remedial:") | |
| print("") | |
| for j in remedial: | |
| print(j) | |
| print("") | |
| while(len(enrichment) < 10): | |
| num1 = random.randint(0,5) | |
| num2 = random.randint(0,5) | |
| if(num1 + num2 < 6): | |
| string = str(num1) + " + " + str(num2) + " = \n" + str(num2) + " + " + str(num1) + " = " | |
| if(enrichment.count(string) == 0): | |
| enrichment.append(string) | |
| print("") | |
| print("Enrichment:") | |
| print("") | |
| for k in enrichment: | |
| print(k) | |
| print("") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment