Link to my code:
Sal’s Shipping Objective (Control Flow Section)
This is my first post, so if I’m not following the desired style, I would like to apologize ahead of time.
It would be appreciated if you inform me how I could improve my posts too!
So, my Sal’s shipping code works decently, printing results that I was hoping to see, but it comes with weird numbers as well.
I have found out that the weird numbers were printing whenever I execute a function that compares the price of the shipping fees and tells the user which option of shipping would be the best fit for them.
def compare(weight): choice = "" gs = Ground_Shipping(weight) ds = Drone_Shipping(weight) ps = 125 if gs > ds and ps > ds: choice = "The cheapest option for your package is Drone Shipping which will be " + str(ds) + " USD." elif ds > gs and ps > gs: choice = "The cheapest option for your package is Ground Shipping which will be " + str(gs) +" USD." else: choice = "The cheapest option for your package is Premium Shipping which will be " + str(ps) +" USD." print(choice)
If I plug in 4.8 in weight, the result comes out as:
The cheapest option for your package is Ground Shipping which will be 34.4 USD.
I am not sure where 34.4 and 43.199… are coming from…