1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ne4ueva [31]
3 years ago
9

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.
Computers and Technology
1 answer:
Marizza181 [45]3 years ago
6 0

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
CODING TIME
Fynjy0 [20]

Answer:

food_list = ['rice', 'beans','yam', 'bread', 'pasta', 'cocoa','tea']

one_more = ['meat']

extend_list = food_list + one_more

print(extend_list)

Output : ['rice', 'beans','yam', 'bread', 'pasta', 'cocoa','tea', 'meat']

food_list.append('milk')

print(food_list)

Output : ['rice', 'beans','yam', 'bread', 'pasta', 'cocoa','tea', 'milk']

food_list.insert(0, 'cake')

print(food_list)

Output : ['cake', 'rice', 'beans','yam', 'bread', 'pasta', 'cocoa','tea']

flowers = ['rose', 'hibiscus', 'lily']

flowers.remove('rose')

print(flowers)

Output : ['hibiscus', 'lily']

To remove rose using pop()

flowers.pop(0)

Explanation:

The + operator and append method adds elements to the end of an existing list item.

The insert method adds element at the specified index

Remove method deletes element by stating the name of the element to be deleted while pop deletes element using the index value of the element.

7 0
3 years ago
Write a program that asks the user for three names, then prints the names in reverse order. Sample Run: Please enter three names
Sauron [17]

Solution:

Since no language was specified, this will be written in Python.

n1, n2, n3 = input ("Enter three names: ").split()

print(n3)

print(n2)

print(n1)

Cheers.

4 0
3 years ago
I've been stuck on these two basic javascript assignments for an embarrassingly long time. The teacher refuses to help me and th
user100 [1]

Answer:

it is 29 0ver 30

Explanation:

i took the quiz

5 0
3 years ago
"Device A" is an 8-port layer 2 managed switch and "Device C" is a 4-port hub. Which of the following describes "Device B," assu
tresset_1 [31]

Answer: (B) Router

Explanation:

A router is one of the type of virtual and the physical networking device which helps in forwarding the message in the form of data packets in the computer system.

  • The main function of the router is that it sends the message over the internet in the form of email and web page.
  • The router sending the data packets by assigning each device a local internet protocol address in the networking.

According to the given question, the router is refers to the Device-B so that it can communicate in normal circumstances in workstation. Therefore, Option (B) is correct.    

4 0
3 years ago
If a binary search is applied to an array with 1024 elements, in the worst case, the main loop executes, approximately, _____.
trasher [3.6K]

Answer:

10.

Explanation:

Binary search divides the array to be search each in half according to the value of the element.

The worst case time complexity of binary search is O(logN).

In this case the time complexity will come out to be log₂(1024)=10.

So the binary search can divide this array in half maximum of 10 times.

Hence the main loop will executes 10 times.

7 0
4 years ago
Other questions:
  • ATMs are particularly helpful for people on unusual schedules.<br> a. True<br> b. False
    5·2 answers
  • How is counting in this circle and square system similar to how we count in our regular lives? How is it different?
    15·1 answer
  • When writing code, how can printing be useful?
    15·1 answer
  • I have a very quick question. So im applying for Early college and i need some future educational goals and maybe im just thinki
    6·1 answer
  • How do I keep my computer and data safe and secure while using the Internet?
    14·2 answers
  • An optical fibre has an attenuation of 0.3 dB/km. If a laser launches an optical power level of PIN (mW) into 35 km length of th
    8·1 answer
  • What game is this?????????????????????
    15·1 answer
  • If someone has the IP address 127.0.0.1 and tries to connect to the address 127.255.252.255, which are they attempting to connec
    8·1 answer
  • Assignment 2: room area <br>programming python in Project Stem​
    8·1 answer
  • True or False? The background color block should be inserted after all the images are added.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!