Added function for area of Sector

This commit is contained in:
Souvikdeb2612
2020-10-19 11:03:54 +05:30
committed by GitHub
parent 3ba50015ef
commit 1e252fec0f

View File

@@ -0,0 +1,12 @@
.__init__ import *
import random
import math
def sectorAreaFunc(maxRadius = 49,maxAngle = 359):
Radius = random.randint(1, maxRadius)
Angle = random.randint(1, maxAngle)
problem = f"Given radius, {Radius} and angle, {Angle}. Find the area of the sector."
secArea = float((Angle / 360) * math.pi*Radius*Radius)
formatted_float = "{:.5f}".format(secArea)
solution = f"Area of sector = {formatted_float}"
return problem, solution