mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
fix linter issues
This commit is contained in:
@@ -11,6 +11,8 @@ genList = []
|
||||
|
||||
SEP = os.sep
|
||||
class Generator:
|
||||
|
||||
|
||||
def __init__(self, title, id, func, kwargs):
|
||||
self.title = title
|
||||
self.id = id
|
||||
|
||||
@@ -24,7 +24,7 @@ def gen_func(minM=-10,
|
||||
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"
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user