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
|
SEP = os.sep
|
||||||
class Generator:
|
class Generator:
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, title, id, func, kwargs):
|
def __init__(self, title, id, func, kwargs):
|
||||||
self.title = title
|
self.title = title
|
||||||
self.id = id
|
self.id = id
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ def gen_func(minM=-10,
|
|||||||
m = m[0]
|
m = m[0]
|
||||||
else:
|
else:
|
||||||
m = f"{m[0]}/{m[1]}"
|
m = f"{m[0]}/{m[1]}"
|
||||||
base = f"y ="
|
base = "y ="
|
||||||
if m != 0:
|
if m != 0:
|
||||||
if m == 1:
|
if m == 1:
|
||||||
base = f"{base} x"
|
base = f"{base} x"
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ def gen_func(unit='m', format='string'):
|
|||||||
# Calculate base area
|
# Calculate base area
|
||||||
base = 4 * half_width * half_length
|
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':
|
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}"
|
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':
|
elif format == 'latex':
|
||||||
return "Latex unavailable"
|
return "Latex unavailable"
|
||||||
else:
|
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,
|
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)
|
w = random.randint(1, maxWidth)
|
||||||
h = random.randint(1, maxHeight)
|
h = random.randint(1, maxHeight)
|
||||||
|
|
||||||
ans = (l*w*h)/3
|
ans = (l * w * h) / 3
|
||||||
|
|
||||||
if format == 'string':
|
if format == 'string':
|
||||||
problem = f"Volume of pyramid with base length = {l} {unit}, base width = {w} {unit} and height = {h} {unit} is"
|
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