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 of these allows the programmer to put data inside a variable?
gregori [183]

Answer:

it's the equal sign "="

5 0
2 years ago
Write the Python code to implement each step of the following algorithm. Your code should use descriptive variable names and per
Lina20 [59]

Answer:

# the number of pizza is initialised

# to 5

number_of_pizza = 5

# number of slice in each pizza

# is initialised to 8

slice_in_each_pizza = 8

# total number of pizza is calculated

total_number_of_slices = number_of_pizza * slice_in_each_pizza

# number of guest who respond yes

# is initialised to 10

number_of_guest_respond_yes = 10

# additional 3 guest is added to existing guest

number_of_guest_respond_yes += 3

# number of left over slice is gotten by using modulo arithmetic

number_of_left_over_slice = total_number_of_slices % number_of_guest_respond_yes

# the number of left over slice

# is printed which is 1

print(number_of_left_over_slice)

Explanation:

Missing Question Part: Use a variable to store the number of pizzas ordered as 5.

Assuming there are 8 slices in each pizza, use a variable to store the total number of slices calculated using the number of pizzas ordered.

Use another variable to store the number of guests who had responded YES as 10.

Three more people responded YES. Update the corresponding variable using an appropriate expression.

Based on the guest count, set up an expression to determine the number of left-over slices if the slices would be evenly distributed among the guests. Store the result of the expression in a variable.

The program is written in Python and it is well commented.

6 0
3 years ago
7.5 code practice please I can't get a 100 on it helpppp :/
Shtirlitz [24]

Answer:

100-7.5=92.5

Explanation:

6 0
3 years ago
Read 2 more answers
If a robot is able to change its own trajectory as per the external conditions, then the robot is considered as the__.
natima [27]

If a robot is able to change its own trajectory as per the external conditions, then the robot is considered the intelligent option (A) is correct.

<h3>What is AI?</h3>

Unlike the natural intelligence exhibited by animals, including humans, artificial intelligence is a form of intelligence demonstrated by robots.

The question is incomplete.

The complete question is:

If a robot can alter its own trajectory in response to external conditions, it is considered to be:

A. intelligent

B. mobile

C. open loop

D. non-servo

E. None of the above

Robots are regarded as intelligent if they can alter their own course in response to environmental factors. These kinds of agents fall into the AI agent or Rational Agent group.

Thus, if a robot is able to change its own trajectory as per the external conditions, then the robot is considered the intelligent option (A) is correct.

Learn more about AI here:

brainly.com/question/27839745

#SPJ4

5 0
2 years ago
When you are saving a file, what does word suggest by default as the name of the document?
LenaWriter [7]
Whatever you have written on the page is what it'll name it.
5 0
3 years ago
Read 2 more answers
Other questions:
  • Brian wants to conduct an online search using a certain phrase he intends to use the word books that belong to the 1800's in his
    8·1 answer
  • Choose the best technology device for the
    12·1 answer
  • Which of the following types of cloud platforms would a webmail service offered to the general public be considered?
    9·1 answer
  • Downloading files is safe for most types of files except Select one: a. documents. b. pictures. c. executable files. d. music fi
    7·1 answer
  • What disese is sue suffering from
    15·2 answers
  • When two or more tables share the same number of columns, and when their corresponding columns share the same or compatible doma
    12·1 answer
  • A cashier distributes change using the maximum number of five dollar bills, followed by one dollar bills. For example, 19 yields
    15·2 answers
  • Complete the sentence with the correct response.
    12·1 answer
  • Write the icon of full justification​
    12·1 answer
  • How can structure of a table change in sql. What general types of changes are possible
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!