mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
15 lines
401 B
Python
15 lines
401 B
Python
from .__init__ import *
|
|
|
|
|
|
def areaOfTriangleFunc(maxA=20, maxB=20, maxC=20):
|
|
a = random.randint(1, maxA)
|
|
b = random.randint(1, maxB)
|
|
c = random.randint(1, maxC)
|
|
|
|
s = (a + b + c) / 2
|
|
area = (s * (s - a) * (s - b) * (s - c)) ** 0.5
|
|
|
|
problem = "Area of triangle with side lengths: " + str(a) + " " + str(b) + " " + str(c) + " = "
|
|
solution = area
|
|
return problem, solution
|