Answered step by step
Verified Expert Solution
Question
1 Approved Answer
data1.txt === http://www.cse.msu.edu/~cse231/Online/Labs/Lab09/data1.txt data2.txt === http://www.cse.msu.edu/~cse231/Online/Labs/Lab09/data2.txt IN Python B. Write a program using Dictionaries Given two files named exactly datal.txt and data2.txt (no error checking
data1.txt === http://www.cse.msu.edu/~cse231/Online/Labs/Lab09/data1.txt
data2.txt === http://www.cse.msu.edu/~cse231/Online/Labs/Lab09/data2.txt
IN Python
B. Write a program using Dictionaries Given two files named exactly "datal.txt" and "data2.txt" (no error checking needed) of names and scores print out the combined scores in alphabetical order by name. Note that the files will be formatted the same, but some names will be in both files and some names will only be in one file. Fornames in both files the scores need to be summed. The file format will be one header line followed by lines that have a name (string) and a number (int) separated by some unknown number of spaces. Requirements (1) You must use a dictionary. (2) You must use two functions that have a dictionary as an argument, e.g. read a file, print results. For example, if data1 contains Name Score 20 Joe Mary 70 Rich 50 Jose 90 and data2.txt contains Name Score Sarah 80 Ming 20 65 Oe Rich 30Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started