← Back

Code Challenge 4.1 - Circle Area Calculator Function


Objective

Your task is to write a program that calculates the area of a circle given its radius. This time, we’ll focus on encapsulating the code into functions/methods.

Skills to Practice:

Challenge Tasks

Python

def calculate_area(radius):
    # code

C#

double CalculateArea(double radius)
{
    // code
}