1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
77julia77 [94]
4 years ago
7

Exercise 8.1.9: Diving Contest Your school is hosting a diving contest, and they need a programmer to work on the scoreboard! Yo

ur 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 can someone help?
Computers and Technology
1 answer:
vampirchik [111]4 years ago
4 0

Answer:

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")

Explanation:

This line defines the function

def calculate_score(theTuple):

This line gets the content of the function

    first, second, third = theTuple

The following if condition checks if the digits are in the range 0 to 10

    if first >= 0 and first <=10 and second >= 0 and second <=10 and third >= 0 and third <=10:

This calculates the sum

         print(first + second+third)

else:

If number is outside range 0 and 10, this line is executed

         print("Range must be 0 to 10")

You might be interested in
Calculator is an example of
Shalnov [3]

D. digital

Explanation:

I hope it helps you

7 0
3 years ago
Find the ratio of 24 to 36​
miv72 [106K]

Answer:

24:36 if you want it in the smallest form it is 2:3

4 0
3 years ago
Read 2 more answers
What is the extension of a BASIC256 program file?​
algol13

Answer:

The extension of a BASIC-256 program file is kbs

4 0
3 years ago
Many application controls are useful for enhancing the reliability of both transaction data and master record data. This applica
Rzqust [24]

Answer:

True

Explanation:

In most accounting software like SAP, Application control performs what is known as validity check.

And Validity check is when this application control compares the data entered into a field for a transaction to that in a master record to verify the data entered exists.

With above definition we can infer that the question statement is true.

5 0
3 years ago
The desktop publishing process begins with A. importing text and graphics into a desktop publishing file. B. designing the page
makkiz [27]
The correct answer to the above question is option D. The very first step in the desktop publishing process<span> creating the raw material, that is text and graphics, which are then imported into a </span><span>desktop publishing file before the layout is designed.</span>
5 0
3 years ago
Other questions:
  • Answer: x = 3<br>#1 -2x + 5 = -31​
    10·1 answer
  • What must be done to translate a posttest loop expressed in the form
    9·1 answer
  • How to transfer photos from iphone to iphone?
    14·2 answers
  • Consider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". Any value that is the same as the immediately preceding value is consi
    6·1 answer
  • Which approach to knowledge management capitalizes on tacit knowledge and requires heavy IT investment?
    8·1 answer
  • Match the different stages of boot sequence with the order in which they occur.​
    15·2 answers
  • What happens when you leave a tablet charging for two days?
    13·1 answer
  • The rate of flow is called
    11·1 answer
  • A computer is performing a binary search on the sorted list of 7 numbers below.
    10·2 answers
  • How communication skills are different from self management skills
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!