Question: Markdown Problem : Join two datasets You are given two files, each containing various measurements ( one measurement per line ) . For instance, these
Markdown
Problem : Join two datasets
You are given two files, each containing various measurements one measurement per line For instance, these measurements could represent the population of different cities file # and their corresponding area in square miles file # Each measurement line begins with an item label the city name followed by a comma, and the measurement value. The measurements are not in any specific order.
For example, file # could have the following lines:
DC
MD
VA
While file # these other lines:
MD
VA
DC
Your task is to join the two files and produce a third set of measurements in this example, it could be the population per square mile All new measurements should be rounded to two decimal places.
Your program should take three parameters : two filenames, and a string specifying the operation to perform. The acceptable operation options are "sum", "subtract", "multiply", or "divide" in this instance, the operation to use would be "divide" It should return a dictionary containing the new set of measurements, where each dictionary entry maps the item's label key to its new measurement value
Finally, your program must print the following message:
Created XX measurements with operation ZZZZ
where is one of the four options above.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
