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
yarga [219]
2 years ago
12

Define a function calc_pyramid_volume with parameters base_length, base_width, and pyramid_height, that returns the volume of a

pyramid with a rectangular base.
Sample output with inputs: 4.5 2.1 3.0
Volume for 4.5, 2.1, 3.0 is: 9.45
Relevant geometry equations:
Volume = base area x height x 1/3
Base area = base length x base width.

given to me
''' Your solution goes here '''
length = float(input())
width = float(input())
height = float(input())
print('Volume for', length, width, height, "is:", calc_pyramid_volume(length, width, height))
Computers and Technology
1 answer:
Sever21 [200]2 years ago
8 0

The missing segment of the code illustrates the use of functions.

Functions are also referred to as <em>procedures or methods</em>; they are set of instructions that act as one.

The code segment that complete the code in the question is as follows:

<em>def calc_pyramid_volume(length, width, height): </em>

<em>    baseArea = length * width </em>

<em>    Volume = baseArea * height * 1/3 </em>

<em>    return Volume</em>

<em />

<em />

The first line of the code segment declares the function itself

<em>def calc_pyramid_volume(length, width, height):</em>

Then, the base area of the pyramid is calculated

<em>    baseArea = length * width</em>

Then, the volume of the pyramid is calculated

<em>    Volume = baseArea * height * 1/3</em>

Lastly, the volume is returned to the main method

<em>    return Volume</em>

So, the complete code (without comments) is:

<em>def calc_pyramid_volume(length, width, height): </em>

<em>    baseArea = length * width </em>

<em>    Volume = baseArea * height * 1/3 </em>

<em>    return Volume </em>

<em>     </em>

<em>length = float(input()) </em>

<em>width = float(input()) </em>

<em>height = float(input()) </em>

<em>print('Volume for', length, width, height, "is:", calc_pyramid_volume(length, width, height))</em>

<em />

See attachment for the sample run

Read more about functions at:

brainly.com/question/17225124

You might be interested in
Which keyboard shortcut cuts information to the clipboard?
anyanavicka [17]

Answer:

control X

Explanation:

It cuts and copies to clipboard

3 0
3 years ago
Jimmy has been issued a citation for littering in a city park. When Jimmy
mixas84 [53]

Answer:

this violates with the

constitution

Explanation:

5 0
3 years ago
What is the name used for the camera s view from a single position?
CaHeK987 [17]
The answer to your question is a shot


6 0
3 years ago
Are all the computer users known as programmer ​
Evgesh-ka [11]

Answer:

Nope

Explanation:

programmers are diff

6 0
2 years ago
In which file format is image data compiled into a binary file? TIFF SVG CGM BMP
Licemer1 [7]

BMP (Bitmap). I may be wrong. I'm sorry.

6 0
3 years ago
Other questions:
  • A Hierarchy Custom Setting stores a specific URL for each profile in Salesforce. Which statement can a developer use to retrieve
    5·1 answer
  • Please help
    5·2 answers
  • Service that connects on-premises software appliances with cloud based storage is ______
    10·1 answer
  • The scheme function (mult2-diff Ist) should take one argument, a list of numbers, and results in multiplying each number in the
    11·1 answer
  • The system partition is the partition that contains the files required to load the operating system (bootmgr, and BCD). The syst
    9·1 answer
  • Describe any five GSM PLMN basic services?
    10·1 answer
  • A small but growing advertising business hires a new secretary. Until now, the computers have been directly connected, and all t
    12·1 answer
  • Different between desktop application and web application ?​
    9·1 answer
  • Examples of email use that could be considered unethical include _____.
    14·2 answers
  • Describe s computer network that you are familiar with ?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!