Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN PYTHON 3: For this problem, you will write some code that checks the weight of a package and then determines the price of shipping

IN PYTHON 3:

For this problem, you will write some code that checks the weight of a package and then

determines the price of shipping based on the weight. The weight of the package will be

represented by a variable named package_weight, and the price of shipping is represented

by a variable named shipping_cost. If the package_weight is less than or equal to 5, the

shipping_cost should be 3; else if the package weight is greater than 5 or less than or equal

to 10, the shipping_cost should be 7, otherwise (if the package is even heavier) the

shipping_cost should be 15.

The first part of your code should look like the following example. Be sure to test your code

with different values of package_weight:

package_weight = 1

if package_weight <= 5:

shipping_cost = 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions