add format kwarg

This commit is contained in:
lukew3
2021-10-06 02:22:32 -04:00
parent 6b35cbb452
commit 9682a569ba
115 changed files with 934 additions and 628 deletions

View File

@@ -2,15 +2,17 @@ from .__init__ import *
from numpy import pi
def degreeToRadFunc(max_deg=360):
def degreeToRadFunc(max_deg=360, format='string'):
a = random.randint(0, max_deg)
b = (pi * a) / 180
b = round(b, 2)
problem = "Angle " + str(a) + " in radians is = "
solution = str(b)
return problem, solution
if format == 'string':
problem = "Angle " + str(a) + " in radians is = "
solution = str(b)
return problem, solution
else:
return a, b
degree_to_rad = Generator("Degrees to Radians", 86, degreeToRadFunc,