Added circle and sphere calculations
parent
fecc030bf1
commit
6b00385f43
|
@ -0,0 +1,9 @@
|
||||||
|
import math
|
||||||
|
PI = math.pi
|
||||||
|
|
||||||
|
radius = float(input("Enter the radius of a circle "))
|
||||||
|
|
||||||
|
area = PI * radius**2
|
||||||
|
|
||||||
|
print(f"The area is {area}")
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
import math
|
||||||
|
PI = math.pi
|
||||||
|
|
||||||
|
radius = float(input("Enter the radius of a sphere "))
|
||||||
|
|
||||||
|
|
||||||
|
volume = 4 / 3 * PI * radius**3
|
||||||
|
|
||||||
|
print(f"The volume of the sphere is {volume}")
|
Loading…
Reference in New Issue