Your school is hosting a diving contest, and they need a programmer to work on the scoreboard! Your job is to calculate each diver's total after the three judges hold up their individual scores. Write the function calculate_score which takes a tuple of three numbers from 0 to 10 and calculates the sum. A perfect dive is worth 30 points, a belly flop is worth 0. For example: calculate_score((10, 10, 10)) # => 30 calculate_score((9, 9, 6)) # => 24

Respuesta :

Answer:

def calculate_score(setss):

    num1, num2, num3= setss

    if num1 >= 0 and num1 <=10 and num2>= 0 and num2<=10 and num3>= 0 and num3<=10:

         print(num1+ num2+num3)

    else:

         print("Out of range")

Explanation:

I've added the full source code as an attachment, where I used comments as explanation

Ver imagen MrRoyal