Westonci.ca is the best place to get answers to your questions, provided by a community of experienced and knowledgeable experts. Discover in-depth answers to your questions from a wide network of professionals on our user-friendly Q&A platform. Get immediate and reliable solutions to your questions from a community of experienced professionals on our platform.
Sagot :
I used python function to write the code.
def averageScore(x,y,z):
s = x + y + z
avg = s/3
if avg >= 90:
return f'Your average test score is {avg} You earned a A.'
elif avg >=80 and avg < 90 :
return f'Your average test score is {avg} You earned a B.'
elif avg >=70 and avg < 80 :
return f'Your average test score is {avg} You earned a .C'
elif avg >=60 and avg < 70 :
return f'Your average test score is {avg} You earned a D.'
else:
return f'Your average test score is {avg} You earned a F.'
print(averageScore(98, 90, 80))
Python function is used to write the code where x, y and z are the argument (user inputs) of the function. Then the inputs are summed and the average is gotten and stored with the variable, avg.
If the average is greater than or equal to 90 the program will give the appropriate score and response(grade). It does the same if the user scored 80 - 89, 70 - 79, 60 - 69 and less than 60.
Finally. the function is called with the user input(argument).
Note the bolded values in the code are keywords in python.
read more: https://brainly.com/question/14191443?referrer=searchResults
We appreciate your visit. Hopefully, the answers you found were beneficial. Don't hesitate to come back for more information. We appreciate your time. Please revisit us for more reliable answers to any questions you may have. We're dedicated to helping you find the answers you need at Westonci.ca. Don't hesitate to return for more.