Question: : Write a function named evaluate _ grade that determines whether a student has passed or failed an exam. The function should have three parameters:

: Write a function named evaluate_grade that determines whether a student has passed or failed an exam. The function should have three parameters:
name (positional-only): The name of the student.
score (positional-only): The student's score on the exam. Assume this will always be an integer in the range of 0 through 100.
passing_score (keyword-only, with the default value 50): The minimum score required to pass the exam.
If the student's score is greater-than or equal-to passing_score, the function should print the message " passed the exam.", where is the value of the name parameter. Otherwise, it should print the message " failed the exam.".
1
2
3
4
5
evaluate_grade(name,score,*,passing_score=50):
ifscore>=passing_score:
print(f"{name}passedtheexam.")
else:
print(f"{name}failedtheexam.")

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 Programming Questions!