Practical 1.1- Intro

Complete the following code so that it also calculates the area of the circle.

The equation for the area of a circle is: A = Pi * r^2

(Note: to calculate the square of the radius, use radius * radius in your code).

# Import math Library
import math

#get radius from user
radius = float(input(“Enter radius: “))

#circumference calculation
circumference = 2 * math.pi * radius
print(“Circumference = “, circumference)

#area calculation

Scroll to Top