Python Online Compiler
Example: How to Find Area of a Circle with Diameter in Python
C
C++
C#
Java
Python
PHP
main.py
STDIN
Run
# How to Find Area of a Circle with Diameter in Python print("Enter the radius of the circle::\n") r, d, c, a = float(input()), None, None, None # r = radius, d = diameter, c = circumference, a = area # It will calculate the diameter, circumference, and area d = 2 * r c = 2 * 3.14 * r a = 3.14 * (r * r) # It will print the final output print("Diameter = ", d, "units") print("Circumference = ", c, "units") print("Area = ", a, " sq. units")
10
Output
Clear
ADVERTISEMENTS