Question: # Import the students variable from data.py from data import students def calculate _ adjusted _ total ( exam _ scores ) : # Sort
# Import the students variable from data.py
from data import students
def calculateadjustedtotalexamscores:
# Sort the scores and take the best two
besttwoscores sortedexamscores, reverseTrue:
# Calculate the average of the best two scores
adjustedtotal roundsumbesttwoscores
return adjustedtotal
def calculatelettergradeadjustedtotal:
# Determine the letter grade based on the adjusted total
if adjustedtotal :
return A
elif adjustedtotal :
return B
elif adjustedtotal :
return C
else:
return F
# Print header
printfFirstName:LastName:AdjTotal:Grade:
# Process each student
for student in students:
firstname studentFirstName
lastname studentLastName
examscores studentExamScores
# Calculate adjusted total and letter grade
adjtotal calculateadjustedtotalexamscores
grade calculatelettergradeadjtotal
# Print only students with an A grade
if grade A:
printffirstname:lastname:adjtotal:grade:
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
