fix linter issues

This commit is contained in:
lukew3
2022-11-05 14:11:29 -04:00
parent 36777d685f
commit 4b38f21017
4 changed files with 7 additions and 5 deletions

View File

@@ -11,6 +11,8 @@ genList = []
SEP = os.sep
class Generator:
def __init__(self, title, id, func, kwargs):
self.title = title
self.id = id

View File

@@ -18,13 +18,13 @@ def gen_func(minM=-10,
"""
if m[0] == 0:
m = 0
elif abs(m[0]) == abs(m[1]):
elif abs(m[0]) == abs(m[1]):
m = m[0] // m[1]
elif m[1] == 1:
m = m[0]
else:
m = f"{m[0]}/{m[1]}"
base = f"y ="
base = "y ="
if m != 0:
if m == 1:
base = f"{base} x"

View File

@@ -29,7 +29,7 @@ def gen_func(unit='m', format='string'):
# Calculate base area
base = 4 * half_width * half_length
ans = base + 2*triangle_1 + 2*triangle_2
ans = base + 2 * triangle_1 + 2 * triangle_2
if format == 'string':
problem = f"Surface area of pyramid with base length = {2*half_length}{unit}, base width = {2*half_width}{unit}, and height = {height}{unit}"
@@ -38,7 +38,7 @@ def gen_func(unit='m', format='string'):
elif format == 'latex':
return "Latex unavailable"
else:
return 2*half_length, 2*half_width, height, ans, unit
return 2 * half_length, 2 * half_width, height, ans, unit
surface_area_pyramid = Generator("Surface area of pyramid", 123, gen_func,

View File

@@ -6,7 +6,7 @@ def gen_func(maxLength=20, maxWidth=20, maxHeight=50, unit='m', format='string')
w = random.randint(1, maxWidth)
h = random.randint(1, maxHeight)
ans = (l*w*h)/3
ans = (l * w * h) / 3
if format == 'string':
problem = f"Volume of pyramid with base length = {l} {unit}, base width = {w} {unit} and height = {h} {unit} is"