Skip to content

Customers ship packages at the lowest available price. (in development)

Notifications You must be signed in to change notification settings

anthonychavis/sals-shipping

Repository files navigation

Sal's Shipping

Practicing control flow & file handling with Python 3

Table of Contents

Introduction

Sal has a shipping company and wants to help her customers find the lowest-cost method of shipping their packages. So, it's my job to write the program to help her customers decide between 3 shipping methods:

  1. drone shipping
  2. ground shipping,
  3. premium ground shipping

Shipping Cost

Drone Shipping

Package Weight (lbs) Price / Pound ($ / lb) Flat Fee ($)
less than or equal to 2 4.50 0.00
more than 2, less than or equal to 6 9.00 0.00
more than 6, less than or equal to 10 12.00 0.00
more than 10 14.25 0.00

Ground Shipping

Package Weight (lbs) Price / Pound ($ / lb) Flat Fee ($)
less than or equal to 2 1.50 20.00
more than 2, less than or equal to 6 3.00 20.00
more than 6, less than or equal to 10 4.00 20.00
more than 10 4.75 20.00

Premium Ground Shipping = $125.00

Technologies

  • Python 3
  • VSCode

Sources

The inspiration for this project was Codecademy's Python 3: Control Flow project called Sal's Shipping.

They provided example code of how to complete the job.

Extra Info

A lot is different from Codecademy's practice project.

  • About the README:
    • The Shipping Cost content was added to this README file programmatically
      • because why would I type tables out in 5 minutes when I could spend much, much more time figuring out how to write a file-handling program to add the tables for me?
    • Need to look into the error handling for the file-handling program
  • About the program to help Sal & her customers:
    • It is currently set to print the results to the terminal
      • it'll likely remain that way for a long time since I'd rather spend more time with Big O at the moment
    • Challenged myself to try syntax that's newer to me
      • there are likely parts of the program that you'd wish were more readable
      • in a few months from now, I'll probably wish the same
    • It is simplified to a function that will take the package weight as an argument
      • could've written the return/print message a bit differently to better present the info to the customer
    • There are example function calls in the use_the_fxn file
      • the purpose of this file is to practice importing functions in Python
    • Need to verify the function's argument type
      • verify/sanitize user input
  • Critique:
    • I'm open to criticism; very much want to improve rapidly
    • If you notice something weird, or unsafe, or have food for thought, please don't hesitate to let me know

Contact

Anthony Chavis

Return to the Table of Contents

Return to the top

About

Customers ship packages at the lowest available price. (in development)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages