Question To be implemented in d5q1.py: mergeList function: You run a store. You have two lists. The first list contains the items sold by the store, it is a list of strings. The second list contains the quantities of these items, it is a list of strings. We want to build a dictionary of articles and quantities of articles in this store. The dictionary keys are the items, and the values are the respective quantities, of the same index. Lists are not necessarily the same length. - If the list of items is longer, then the dictionary will have zero quantities (= 0) for those items. - If the list of quantities is longer, then the dictionary will contain articles whose name is article_inconnu_i, i being an index: →i starts from 0 until the number of unknown articles - 1. Expand a Python function, called mergeList. This function takes as a parameter the two lists described above. The function returns the constructed dictionary. • To be implemented in d5p1.py in the main program: 1- Import d5q1 that you have implemented (use import or from ... import). 2- Ask the user to enter the elements of each list separated by commas on the keyboard 3- Call the function implemented in d5q1.py by passing it the two lists read on the keyboard 4- Display the result as in the examples. Please respect the Example: Please enter the list of items separated by commas: shirt, t-shirt, pants, dress, socks, shoes Please enter a list of quantities separated by commas: 20,15,25,30,10,27 the store's stock is: {'shirt': '20', 't-shirt': '15', 'pants': '25', 'dress': '30', 'socks': '10', 'shoes': '27'} >>>

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

It's two different code in two different files please help.

Question
To be implemented in d5q1.py: mergeList function:
You run a store. You have two lists. The first list contains the items sold by the store, it is a list of strings.
The second list contains the quantities of these items, it is a list of strings.
We want to build a dictionary of articles and quantities of articles in this store. The dictionary keys are the
items, and the values are the respective quantities, of the same index.
Lists are not necessarily the same length.
- If the list of items is longer, then the dictionary will have zero quantities (= 0) for those items.
- If the list of quantities is longer, then the dictionary will contain articles whose name is article_inconnu_i,
i being an index:
→i starts from 0 until the number of unknown articles - 1.
Expand a Python function, called mergeList. This function takes as a parameter
the two lists described above. The function returns the constructed dictionary.
• To be implemented in d5p1.py in the main program:
1- Import d5q1 that you have implemented (use import or from ... import).
2- Ask the user to enter the elements of each list separated by commas on the keyboard
3- Call the function implemented in d5q1.py by passing it the two lists read on the keyboard
4- Display the result as in the examples.
Please respect the Example:
Please enter the list of items separated by commas:
shirt, t-shirt, pants, dress, socks, shoes
Please enter a list of quantities separated by
commas:
20,15,25,30,10,27
the store's stock is:
{'shirt': '20', 't-shirt': '15', 'pants': '25', 'dress':
'30', 'socks': '10', 'shoes': '27'}
>>>
Transcribed Image Text:Question To be implemented in d5q1.py: mergeList function: You run a store. You have two lists. The first list contains the items sold by the store, it is a list of strings. The second list contains the quantities of these items, it is a list of strings. We want to build a dictionary of articles and quantities of articles in this store. The dictionary keys are the items, and the values are the respective quantities, of the same index. Lists are not necessarily the same length. - If the list of items is longer, then the dictionary will have zero quantities (= 0) for those items. - If the list of quantities is longer, then the dictionary will contain articles whose name is article_inconnu_i, i being an index: →i starts from 0 until the number of unknown articles - 1. Expand a Python function, called mergeList. This function takes as a parameter the two lists described above. The function returns the constructed dictionary. • To be implemented in d5p1.py in the main program: 1- Import d5q1 that you have implemented (use import or from ... import). 2- Ask the user to enter the elements of each list separated by commas on the keyboard 3- Call the function implemented in d5q1.py by passing it the two lists read on the keyboard 4- Display the result as in the examples. Please respect the Example: Please enter the list of items separated by commas: shirt, t-shirt, pants, dress, socks, shoes Please enter a list of quantities separated by commas: 20,15,25,30,10,27 the store's stock is: {'shirt': '20', 't-shirt': '15', 'pants': '25', 'dress': '30', 'socks': '10', 'shoes': '27'} >>>
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Operations of Linked List
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education