mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
lint fixes
This commit is contained in:
@@ -4,10 +4,10 @@ from .__init__ import *
|
||||
def gen_func(maxValue=100, minValue=-100, format='string'):
|
||||
observed_value = random.randint(minValue, maxValue)
|
||||
exact_value = random.randint(minValue, maxValue)
|
||||
|
||||
|
||||
if observed_value * exact_value < 0:
|
||||
observed_value *= -1
|
||||
|
||||
|
||||
error = (abs(observed_value - exact_value) / abs(exact_value)) * 100
|
||||
error = round(error, 2)
|
||||
|
||||
@@ -24,5 +24,5 @@ def gen_func(maxValue=100, minValue=-100, format='string'):
|
||||
|
||||
|
||||
percentage_error = Generator(
|
||||
"Percentage error", 114, gen_func,
|
||||
["maxValue=100", "minValue=-100"])
|
||||
"Percentage error", 114, gen_func,
|
||||
["maxValue=100", "minValue=-100"])
|
||||
|
||||
@@ -4,7 +4,7 @@ from .__init__ import *
|
||||
def gen_func(maxA=20, maxB=20, format='string'):
|
||||
a = random.randint(1, maxA)
|
||||
b = random.randint(1, maxB)
|
||||
c = random.randint(abs(b-a)+1, abs(a+b)-1)
|
||||
c = random.randint(abs(b - a) + 1, abs(a + b) - 1)
|
||||
|
||||
s = (a + b + c) / 2
|
||||
area = (s * (s - a) * (s - b) * (s - c))**0.5
|
||||
|
||||
Reference in New Issue
Block a user