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]
3 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]3 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
Use an ifstream object named indata to read the first three integers from a file called lottowins and write each number to stand
Gemiola [76]

Answer:

int x;

indata.open("lottowins");

indata >> x;

cout << x << endl;

indata >> x;

cout << x << endl;

indata >> x;

cout << x << endl;

indata.close();

4 0
3 years ago
How to improve and create beautiful graphic
kaheart [24]

Answer:

Learn OpenGL and any graphics rendering program.

Explanation:

3 0
4 years ago
What is the current record holder for the fastest car in the world? What is the top speed of it? 100 points to whoever gets it c
olchik [2.2K]
It’s 257 mph

Hope this helps !!!!!
7 0
3 years ago
Read 2 more answers
PLEASEE HELPP.... QUESTION... how does coding impact your life​
nataly862011 [7]

Answer: It allows us to do everyday tasks on the internet

Explanation: We wouldn’t be able to email, research, etc without coding!

6 0
3 years ago
Read 2 more answers
100 POINTS + BRAINLYEST FOR FIRST PERSON THAT GETS IT RIGHT!!!! While writing a formula, what are some ways to insert a cell ref
nexus9112 [7]

Answer:

Line second and third i.e, "typing the cell name, like "B4"  and clicking the cell to reference " the correct answer.

Explanation:

It relates to some kind of set of cells on the worksheet, which could be used to calculates the formula. It also helps to locate the information, which you want to analyze in the calculation. It can also provide the cell reference in  more than one formula in the same worksheet, that relates to Information on many other workbooks, and wrong choices can be described as follows:

  • Hovering provides the basic details, in which we hover, that's why it is wrong .
  • Zooming is used in projection, it can't be used in the cell reference, that's why it is wrong.
7 0
4 years ago
Read 2 more answers
Other questions:
  • If you wanted to only view the sales of $200,000+ in the table above, which number filter would you select?
    7·1 answer
  • What is the difference between pulse code modulation and delta modulation? Provide examples.
    11·1 answer
  • What is software piracy
    12·2 answers
  • You are using a crimper to attach an RJ-45 connector to a Cat 6 UTP cable. You need to use the T568A standard to connect the ind
    6·1 answer
  • Your computer system is a participant in an asymmetric cryptography system. You've crafted a message to be sent to another user.
    13·1 answer
  • You are between flights at the airport and you want to check your email. Your wireless settings show two options:
    14·1 answer
  • Que papel tuvo la innovación en la propagación de la telefonía móvil?​
    7·1 answer
  • What refers to a collection of small sections of code that are stored together to solve many everyday programs?
    11·2 answers
  • 1. What are the advantages and disadvantages of technology in communication?
    9·2 answers
  • If you are using a sprite for your MakeCode Arcade game, which code block
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!