Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Looking for python code for below problem using tuples -------------------------

ID: 3910625 • Letter: L

Question

Looking for python code for below problem using tuples

---------------------------------------------------

The Gocargo are adding additional features to their Shipping management system to help their Support process. The Support desk is finding it difficult to filter the cargos with the departure dates from the data available. List of cargos is given along with the departure date.

Write a piece of code that will display all the given Cargo details in the form of list of tuples. Also implement a date filter, that displays the cargos with departure date greater than the given date, to help the Support desk with this regard?

Input Format :
            The first line of input is an integer that corresponds to the number of records, 'n'.
            The next 'n' line corresponds to the records.
            The last line of input consists of the date to be filtered.

Output format :
           
The first line of the output is a set of comma seperated strings containing the cargo name and date.
        The next lines consists of the names of the cargos printed one next to the other seperated by new line.
        Refer to sample input and output for formatting specifications and more details.

Sample Input 1:
5
Allegan,11-12-2013
Douglas,29-12-2016
Junkers,27-03-2017
Biruinta,10-04-2014
ABC,27-03-2017
27-03-2016

Sample Output 1:
[('Allegan', '11-12-2013'), ('Douglas', '29-12-2016'), ('Junkers', '27-03-2017'), ('Biruinta', '10-04-2014'), ('ABC', '27-03-2017')]
Douglas
Junkers
ABC

Explanation for Sample:
First line of the output contains the cargo details in the form of list of tuples.
The next 3 lines are the cargo names whose departure date is greater than or equal to the given date with which filtering is done.

--------------------------------------

Thanks

Explanation / Answer

Solution:

cargo.py

Sample Run:

5
Allegan,11-12-2013
Douglas,29-12-2016
Junkers,27-03-2017
Biruinta,10-04-2014
ABC,27-03-2017
27-03-2016
[('Allegan', '11-12-2013'), ('Douglas', '29-12-2016'), ('Junkers', '27-03-2017'), ('Biruinta', '10-04-2014'), ('ABC', '27-03-2017')]
Douglas
Junkers
ABC

Note: If you have any doubt or queries then please do comment below, before giving any negative feedback. If you liked the solution then dont forget to give a big thumbs up.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote