Click here to Skip to main content
15,945,109 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Write a code in python’s data structures (only in linked list) of:

Cargo system

Take information from user (Name, passport number)
Ask user to select country from (Australia, USA)
If Australia
Ask user “what kind of package do you want to send: a) luggage b) car c) Mail”

If a)
Ask weight of luggage
Calculate and show price= 75 $ /kg

If b)

Ask user “Select type of vehicle 1) light weight 2) heavy weight 3) motorcycles”
If 1)
“Price is =2500$”
If 2)
“Price is 3500$”

If 3)
“Price is 1000$”

If c)
Ask for address “enter address”
Show “Price is 100”

“same as above”

PS: you are only supposed to use linked list

What I have tried:

import collections

# initialising a deque() of arbitrary length

linked_lst = collections.deque()

# filling deque() with elements




print("elements in the linked_list:")


# adding element at an arbitrary position

linked_lst.insert(1, 'fourth')

print("elements in the linked_list:")


# deleting the last element

print("elements in the linked_list:")


# removing a specific element


print("elements in the linked_list:")

Updated 9-Jan-22 6:20am
OriginalGriff 9-Jan-22 12:21pm    
What does it do that you didn't expect, or not do that you did?
What have you tried to do to find out why?
Are there any error messages, and if so, where and when? What did you do to make them happen?

This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
Use the "Improve question" widget to edit your question and provide better information.
Richard MacCutchan 10-Jan-22 4:12am    
What you have tried has no relevance to what you have been asked to create.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900