Python : Zip Code based dispatch

Dear All,

I have just started learning Python. I have worked for 20+ years in supply chain management.
I am trying to create an system, below is the business requirement, please help me to create the program.

Help me learn to write logic.

Kind regards,