def determine_pass_fail(scores, passing_score=50):
"""
Determines if a student passes or fails based on their scores in multiple subjects.
Args:
scores: A dictionary where keys are subject names and values are scores.
passing_score: The minimum score required to pass in each subject.
Returns:
"Pass" if the student passes in all subjects, "Fail" otherwise.
"""
for subject, score in scores.items():
if score < passing_score:
return "Fail" # Fails if any subject is below passing score
return "Pass" # Passes only if all subjects are above passing score
# Example usage:
student_scores = {
"Math": 75,
"Science": 60,
"English": 80,
"History": 45
}
result = determine_pass_fail(student_scores)
print(f"The student's result is: {result}")
ZGVmIGRldGVybWluZV9wYXNzX2ZhaWwoc2NvcmVzLCBwYXNzaW5nX3Njb3JlPTUwKToKICAiIiIKICBEZXRlcm1pbmVzIGlmIGEgc3R1ZGVudCBwYXNzZXMgb3IgZmFpbHMgYmFzZWQgb24gdGhlaXIgc2NvcmVzIGluIG11bHRpcGxlIHN1YmplY3RzLgoKICBBcmdzOgogICAgc2NvcmVzOiBBIGRpY3Rpb25hcnkgd2hlcmUga2V5cyBhcmUgc3ViamVjdCBuYW1lcyBhbmQgdmFsdWVzIGFyZSBzY29yZXMuCiAgICBwYXNzaW5nX3Njb3JlOiBUaGUgbWluaW11bSBzY29yZSByZXF1aXJlZCB0byBwYXNzIGluIGVhY2ggc3ViamVjdC4KCiAgUmV0dXJuczoKICAgICJQYXNzIiBpZiB0aGUgc3R1ZGVudCBwYXNzZXMgaW4gYWxsIHN1YmplY3RzLCAiRmFpbCIgb3RoZXJ3aXNlLgogICIiIgoKICBmb3Igc3ViamVjdCwgc2NvcmUgaW4gc2NvcmVzLml0ZW1zKCk6CiAgICBpZiBzY29yZSA8IHBhc3Npbmdfc2NvcmU6CiAgICAgIHJldHVybiAiRmFpbCIgICMgRmFpbHMgaWYgYW55IHN1YmplY3QgaXMgYmVsb3cgcGFzc2luZyBzY29yZQogIHJldHVybiAiUGFzcyIgICMgUGFzc2VzIG9ubHkgaWYgYWxsIHN1YmplY3RzIGFyZSBhYm92ZSBwYXNzaW5nIHNjb3JlCgoKIy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