Receiving two values separately
Fill in the blanks · Medium · §8.4 Returning several values
This function returns the number of passing scores and the number of failing scores together. Fill in the blank so that the two returned values are stored in two separate variables.
Code with blanks
def pass_fail(scores, cutoff):
p = 0
for s in scores:
if s >= cutoff:
p += 1
return p, len(scores) - p
____ = pass_fail([55, 80, 92, 70], 60)
print("Pass", passed, "Fail", failed)Solve this problem in your browser
Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.