Question: Python: Write a function (including docstring) called brick_tower which takes as input three non-negative integers. The first input denotes the number of large bricks you

Python:

Write a function (including docstring) called brick_tower which takes as input three non-negative integers. The first input denotes the number of large bricks you have available. The second input denotes the number of small bricks you have available. The third one indicates the height (in inches) of the tower you want to build. Large bricks have a height of 7 inches, while small bricks have a height of 2 inches. Your function returns true if you can build a brick tower of the specified height given the available bricks, false otherwise. Note that if the third input is 0, the function should return true.

For example: >>> brick_tower(1, 3, 13) True >>> brick_tower(1, 3, 14) False >>> brick_tower(2, 3, 14) True >>> brick_tower(2, 3, 15) False

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!