Response:
def calculate_score(theTuple):
first, second, third = theTuple
if first >= 0 and first <=10 and second >= 0 and second <=10 and third >= 0 and third <=10:
print(first + second + third)
else:
print("Range must be 0 to 10")
Clarification:
This line initiates the function
def calculate_score(theTuple):
This line extracts the values used in the function
first, second, third = theTuple
The subsequent if statement verifies whether the values fall within the 0 to 10 range
if first >= 0 and first <=10 and second >= 0 and second <=10 and third >= 0 and third <=10:
This computes the total score
print(first + second + third)
else:
Should the scores be outside the 0 to 10 limits, this line will be executed
print("Range must be 0 to 10")