Lets try this guysđ..for me ,am stuckđŁ
1. The value of pi can be calculated numerically in many ways. One approach is to use the âdartboardâ method. This involves randomly âthrowing dartsâ at a square with (x,y) extent of +/-1, and considering the fraction of darts which lie within a circle of radius 1 (the dartboard). Follow the steps given below to estimate the value of pi using the âdartboardâ method (10mks) a. Import the math and random modules. (1mk) b. Set a value for the number of darts to be used. (e.g. ndarts = 1000). (1mk) c. For each dart, calculate a random (x,y) coordinate uniformly distributed within the range (-1,1), using the random.uniform() function. (1mks) d. Write a function called isInTheCircle() which takes the (x,y) coords of the dart, and returns True if the dart lies within the dartboard (a circle of radius 1), and False otherwise. (3mks) e. Loop, over the number of darts thrown, keeping track of the total number of times the dart hits the dartboard (nhit). (3mks)