mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
added latex to 2, 3, 6, 8, 13, 16
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user