<jupyter_start><jupyter_text>Now You Code 3: Area and CircumferenceIn this assignment you are tasks with writing a program which inputs the radius of a circle, and outputs the circumference and area of that circle. Feel free to lookup the formulas online. We will use the **Write - Refactor - Test - Rewrite** approach to complete the final solution which uses functions.**NOTE** `import math` then use `math.PI` to get the value of Pi https://en.wikipedia.org/wiki/Pi  Step 1: WriteHere's the algorihm of this program. Write the solution in Python.```    input radius as a float    calculate circle area    calculate circle circumference    print radius, area, and circumference```Example run:```Enter Radius: 1A circle with radius 1.000000 has area 3.141593 and circumference 6.283185```<jupyter_code>import math
## TODO: Write the solution here Step 1
radius=float(input("Enter the radius: "))
circumference=3.141593*(2*radius)
area=3.141593*(radius*radius)
print("A circle with a radius of %.4f has a circumference of %.4f and an area of %.4f " %(radius,circumference,area))<jupyter_output>Enter the radius: 3
A circle with a radius of 3.0000 has a circumference of 18.8496 and an area of 28.2743<jupyter_text>Step 2: RefactorNext we need to refactor the `area` and `circumfrence` logic into functions. - `CircleArea()` has one input a `radius` and returns the `area` as output.- `CircleCircumference()` has one input a `radius` and returns the `circumference` as output.<jupyter_code>## Step 2: Refactor into two functions def CircleArea... and def CircleCircumference
def CircleArea(radius):
    return(area)
def CircleCircumference(radius):
    return(circumference)<jupyter_output><empty_output><jupyter_text>Step 3: Test Time to test. Write two tests, once for each function```WHEN radius=1 We EXPECT CircleArea(radius) to return 3.141593 WHEN radius=1 We EXPECT CircleCircumference(radius) to return 6.283185```Make sure you call the function to get the actual, just like in the coding lab. NOTE: If its accurate to 4 decimal places, that's sufficient. The test values might be different because of how the "%f" format code works.<jupyter_code># Step 3: Write tests.
("When radius=1 We EXPECT CircleArea(radius) to return 3.141593")
("When radius=1 We EXPECT CircleCircumference(radius) to return 6.283185")<jupyter_output>Enter the radius: 3
The circumference is 18.849558 and the area is 28.274337<jupyter_text>Step 4: rewrite the program to use the functionFinally re-write the original program, but call the functions.<jupyter_code>## Step 4: Write program here from the algorithm above
radius=float(input("Enter the radius: "))
CircleCircumference(radius)
CircleArea(radius)
print("The circumference is", CircleCircumference(radius), "and the area is", CircleArea(radius))<jupyter_output>Enter the radius: 1
The circumference is 18.849558 and the area is 28.274337
{'fraction_non_alphanumeric': 0.08579367836054186, 'fraction_numerical': 0.04654393886766238, 'mean_word_length': 5.515837104072398, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '397960', 'license': 'MIT', 'n_tokens_mistral': 930, 'n_tokens_neox': 806, 'n_words': 364, 'path': 'content/lessons/05/Now-You-Code/NYC3-Area-Circumfrence.ipynb', 'repo_name': 'MahopacHS/spring-2020-milmerstadtj0825', 'size': '2879'}