Design a function called acronym that takes two strings


Problem

I. Design a function called calculate_shipping_cost that takes 3 arguments: the weight of a package in lbs and the length and width of a letter in cm (with arguments in this order). The function should calculate and return the cost of shipping that package

The function should assume the weight, length and width are greater than 0.

The rules for shipping cost calculations are as follows:

1) If the letter is not bigger than the max area of 282cm2 and the weight is not more than 0.05kg it is a standard size letter and should be charged:

• $2.05 for the baserate + additional 2 cents per 1 gram of weight above 0.03kg

2) Otherwise the letter is non-standard and should be charged:

• $2.90 for the baserate + additional 0.5 cents per 1 gram of weight above 0.1kg

For example, if the function is called as get_shipping_cost(0.24, 12, 10) it should return the value 2.6.
This is because the package is 12 by 10 cm and weighs 0.24 kgs, and is therefore a non-standard package. It is 140 grams over the 0.1kg non-standard weight limit, therefore the shipping cost would be calculated as: 1.90 + 140 * 0.005 which is 2.6

NOTE: think about how to call a previous function as a helper function!

II. Design a function called acronym that takes two strings and appends the first letter in each string into one new string with no spaces and returns it.

For example, if the function is called as: acronym('Hello there', 'Friend') the function should return the value 'HF'.

Request for Solution File

Ask an Expert for Answer!!
Python Programming: Design a function called acronym that takes two strings
Reference No:- TGS03249134

Expected delivery within 24 Hours