Session Ready
Exercise

Import package

As a data scientist, some notions of geometry never hurt. Let's refresh some of the basics.

For a fancy clustering algorithm, you want to find the circumference, \(C\), and area, \(A\), of a circle. When the radius of the circle is r, you can calculate \(C\) and \(A\) as:

$$C = 2 \pi r$$ $$A = \pi r^2 $$

To use the constant pi, you'll need the math package. A variable r is already coded in the script. Fill in the code to calculate C and A and see how the print() functions create some nice printouts.

Instructions
100 XP
  • Import the math package. Now you can access the constant pi with math.pi.
  • Calculate the circumference of the circle and store it in C.
  • Calculate the area of the circle and store it in A.