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
vitfil [10]
4 years ago
9

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

id with a rectangular base. Sample output with inputs: 4.5 2.1 3.0
Computers and Technology
1 answer:
jok3333 [9.3K]4 years ago
5 0

Answer:

def pyramid_volume(base_length,base_width,pyramid_height):

      return base_length * base_width * pyramid_height/3

length = float(input("Length: "))

width = float(input("Width: "))

height = float(input("Height: "))

print("{:.2f}".format(pyramid_volume(length,width,height)))

Explanation:

This line declares the function along with the three parameters

def pyramid_volume(base_length,base_width,pyramid_height):

This line returns the volume of the pyramid

      return base_length * base_width * pyramid_height/3

The main starts here

The next three lines gets user inputs for length, width and height

<em>length = float(input("Length: "))</em>

<em>width = float(input("Width: "))</em>

<em>height = float(input("Height: "))</em>

This line returns the volume of the pyramid in 2 decimal places

print("{:.2f}".format(pyramid_volume(length,width,height)))

You might be interested in
Rate my dog out of ten give explanation why
Karolina [17]

Answer:

10/10

Explanation:

i love dogs. he's a super cute dog and i love him without even knowing him

7 0
3 years ago
Who need best OCR app . I will help you.​
myrzilka [38]

Answer:

i do

Explanation:

7 0
3 years ago
It is considered good practice to save a presentation before printing it. true false
Ilya [14]
It is true because it is really a good practise to save a presentation before printing it

5 0
3 years ago
By default, headers and footers apply to
AleksAgata [21]
Hold up I know he answer
6 0
3 years ago
The contents of a four-bit register are initially 1011. The register is shifted six times to the right, with the serial input be
balu736 [363]

Answer:

First shift - 1101

Second shift - 0110

Third shift - 1011

Fourth shift - 1101

Fifth shift - 0110

Sixth shift - 1011

Explanation:

Each time you shift a register to the right, you do 3 things:  

  • The rightmost digit drops off
  • You move the next three digits over one position to the right
  • You fill in the leftmost position with one of the numbers from your serial input.

Contents are initially 1011.  The 1 on the right disappears.  The leftmost 3 digits (101) end up in the last 3 positions of the register.  The first position of the register takes a number from the serial input, which is 1 in this case.  So you end up with 1101.

Do this a second time.  The rightmost 1 is gone, the 110 end up as the last 3 positions of the register, and you end up with 0 in the leftmost position.  This one is 0110.

The remaining 4 follow the same pattern.

4 1
3 years ago
Other questions:
  • Which hypervisor works on older pcs without hardware virtualization support?
    9·2 answers
  • Which of the following is the most accurate description of what is known as the "digital divide". The digital divide is about ho
    5·2 answers
  • Which of the following can computer maintenance software determine?
    6·1 answer
  • A successful web-based strategy that helps a business spread the word about its website and products is called:
    15·1 answer
  • How do motion sensors determine in simation
    13·1 answer
  • Before a new email application could be released to the public, it was released for a few days to some account holders of a webs
    14·2 answers
  • Which two things can a user view in the Reading pane?
    6·2 answers
  • Basic python coding, What is the output of this program? Assume the user enters 2, 5, and 10.
    8·1 answer
  • JAVA
    13·1 answer
  • Edhesive code practice 6.3
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!