Westonci.ca is the ultimate Q&A platform, offering detailed and reliable answers from a knowledgeable community. Discover detailed solutions to your questions from a wide network of experts on our comprehensive Q&A platform. Explore comprehensive solutions to your questions from knowledgeable professionals across various fields 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
Thank you for visiting. Our goal is to provide the most accurate answers for all your informational needs. Come back soon. We appreciate your time. Please come back anytime for the latest information and answers to your questions. Thank you for choosing Westonci.ca as your information source. We look forward to your next visit.