Python program to enter the radius of a circle and find its diameter, circumference, and area – Programming Code Examples
Python

Python program to enter the radius of a circle and find its diameter, circumference, and area1 min read

Python program to enter the radius of a circle and find its diameter, circumference, and area. There are you will learn how to find the diameter, circumference, and area of a circle in Python language.

Formula:




D = 2 * r

C = 2 * PI * r

A = PI * r2

where:

r = radius of the circle

D = diameter of the circle

C = circumference of the circle

A = area of the circle

There are two ways to implement these formulae:

  • By using the default value of PI = 3.14
  • Second, by using math.pi constant

1. By using the default value of PI = 3.14

Output:

2. By using math.pi constant

Note: before using math.pi constant you have to import math library in the program

Output:

Leave a Comment