mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
updated repo
This commit is contained in:
14
mathgenerator/funcs/perimeter_of_polygons.py
Normal file
14
mathgenerator/funcs/perimeter_of_polygons.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
from .__init__ import *
|
||||||
|
from ..__init__ import Generator
|
||||||
|
|
||||||
|
|
||||||
|
def perimeterOfPolygonFunc(maxSides=12, maxLength=120)->"cm":
|
||||||
|
size_of_sides = random.randint(3,maxSides)
|
||||||
|
sides = []
|
||||||
|
for x in range(size_of_sides):
|
||||||
|
sides.append(random.randint(1,maxLength))
|
||||||
|
problem = "The perimeter of a " + str(size_of_sides) + " sided polygon with lengths of " + str(sides) + "cm is: "
|
||||||
|
solution = 0
|
||||||
|
for y in range(len(sides)):
|
||||||
|
solution += sides[y]
|
||||||
|
return problem, solution
|
||||||
Reference in New Issue
Block a user