added latex to 2, 3, 6, 8, 13, 16

This commit is contained in:
lukew3
2020-12-17 21:00:11 -05:00
parent 084888d404
commit e4fe60a4c9
6 changed files with 53 additions and 23 deletions

View File

@@ -1,12 +1,16 @@
from .__init__ import *
def squareFunc(maxSquareNum=20):
def squareFunc(maxSquareNum=20, style='raw'):
a = random.randint(1, maxSquareNum)
b = a * a
problem = str(a) + "^2" + "="
solution = str(b)
if style == 'latex':
problem = "\\(" + str(a) + "^{2}=\\)"
solution = "\\(" + str(b) + "\\)"
else:
problem = str(a) + "^2" + "="
solution = str(b)
return problem, solution