The volume of a sphere is 4/3πr3, where π has the value of "pi". Write a function called print_volume (r) that takes an argument
for the radius of the sphere, and prints the volume of the sphere.
Call your print_volume function three times with different values for radius.
1 answer:
Answer:
In Python:
def print_volume (r):
volume = 4/3 * 3.142*r**3
print(volume)
print_volume(7)
print_volume(14)
print_volume(22)
Explanation:
This defines the function and takes radius r as the parameter
def print_volume (r):
This calculates the volume
volume = 4/3 * 3.142*r**3
This prints the volume
print(volume)
The next three lines call the function with different values
<em>print_volume(7)</em>
<em>print_volume(14)</em>
<em>print_volume(22)</em>
You might be interested in
1. Because you can get the same features for a better price
2. CPU, GPU, RAM, Storage, OS, etc.
Answer:
i not know mainframe computer there is many use of computer
!
gcoo!!Exykgvyukhhytocfplanationufvhyg:
Answer:
You too?
Explanation: