Data structure (Python)

Please following the requirement which is in the PDF file, and give the same output as the PDF file shows.