mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
fix linter errors
This commit is contained in:
@@ -2,20 +2,20 @@ from .__init__ import *
|
|||||||
|
|
||||||
|
|
||||||
def gen_func(maxLength=20, maxWidth=20, maxHeight=50, unit='m', format='string'):
|
def gen_func(maxLength=20, maxWidth=20, maxHeight=50, unit='m', format='string'):
|
||||||
l = random.randint(1, maxLength)
|
length = random.randint(1, maxLength)
|
||||||
w = random.randint(1, maxWidth)
|
width = random.randint(1, maxWidth)
|
||||||
h = random.randint(1, maxHeight)
|
height = random.randint(1, maxHeight)
|
||||||
|
|
||||||
ans = (l * w * h) / 3
|
ans = (length * width * height) / 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 = {length} {unit}, base width = {width} {unit} and height = {height} {unit} is"
|
||||||
solution = f"{ans} {unit}^3"
|
solution = f"{ans} {unit}^3"
|
||||||
return problem, solution
|
return problem, solution
|
||||||
elif format == 'latex':
|
elif format == 'latex':
|
||||||
return "Latex unavailable"
|
return "Latex unavailable"
|
||||||
else:
|
else:
|
||||||
return l, w, h, ans, unit
|
return length, width, height, ans, unit
|
||||||
|
|
||||||
|
|
||||||
volume_pyramid = Generator("Volume of pyramid", 122, gen_func,
|
volume_pyramid = Generator("Volume of pyramid", 122, gen_func,
|
||||||
|
|||||||
Reference in New Issue
Block a user