lint fixes

This commit is contained in:
lukew3
2021-10-09 13:42:56 -04:00
parent 5133642be6
commit d6fa5e346e
2 changed files with 5 additions and 5 deletions

View File

@@ -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"])

View File

@@ -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