Question: Write a Python program that processes a file called inp.txt whose structure is described previously, to produce output with the following structure ( however ,

Write a Python program that processes a file called inp.txt whose structure is described previously, to produce output with the following structure (however, your program is allowed to print these lines in any order).
For each unikey, give the number of units where the students mark in that unit in 2016 is at least 85. If none of the students results in that year are in the required range, show 0 as the number of units. You may assume that every student mentioned in the file studied one or more subjects in 2016.
If there are no rows other than the header in the input, nothing should be printed at all.
So when run with the file given above as input, the output should be (in some order):
jsmi30310
ocat30311
tgol21450
pdon12342
In 2016, pdon1234 has grades of 85 or more in 2 units (engl1001 and math1001). ocat3031 has 85 or more in 2016 in 1 unit (math1001); note that this students mark in chem1101 is below 85, and the high score in engl1001 is in a different year.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!