mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
add format kwarg
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user