Rachel M.

asked • 01/24/23

How would I start this program

I have def ted_fruit(fruit,fruit_quantity,fruit_cost).

Ted, the TA, wants to buy fruit from the grocery. Define a function named ted_fruit(fruit, fruit_quantity, fruit_cost) that takes in the name of the fruit, the number of the fruit Ted will buy and the cost of each fruit. The function will print out a sentence stating the fruit and the number of the fruit he purchased, and return the price of all the fruit with a 7% sales tax.

Examples:

ted_fruit("lemons", 20, 3) prints "Ted bought 20 lemons." and returns 64.2

ted_fruit("orange", 1, 0) prints "Ted bought 1 orange." and returns 0.0

ted_fruit("tomatoes", 3, 2.8) prints "Ted bought 3 tomatoes." and returns 8.988


1 Expert Answer

By:

Samuel L. answered • 01/25/23

Tutor
5.0 (72)

Internationally Published Author in Computer Science

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.