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 the table on the right to convert from binary to decimal.
postnew [5]

Answer:

There is no table, so I can only comment on the statements:

The binary value of decimal 10 is A.  ==> False, however A is a hexadecimal representation of 10.

The binary value of decimal 13 is 1001  ==> False, 13 would be 1101.

The binary value of decimal 15 is 1111.  ==> True.

The binary value of decimal 14 is E. ==> Again E is a hexadecimal representation of 14.

7 0
2 years ago
Read 2 more answers
What is the shortcut key to apply /remove the subscript effect?<br> Ctrl+=<br><br> Ctrl-+
telo118 [61]

Answer:

Press "Ctrl, "Shift" and "=" on your keyboard to turn off superscript formatting.

5 0
2 years ago
During a user’s onboarding process, many designers focus on a gradual release of information. This process is called what?
mrs_skeptik [129]

progressive disclosure

3 0
2 years ago
how could environmental and energy problem Kenya faces as far computer installations are concerned be avoided​
ipn [44]

The environmental and energy problem Kenya faces as far computer installations are concerned can be avoided​ by

  • Knowing and finding out the key aspect of ICT strength.
  • Create an holistic judgements in the assessment of ICT capability. Promote the use of solar power.

<h3>How can we overcome ICT challenges?</h3>

There are a lot of Energy Challenges in terms of ICT  in Kenyan and it is good the government and the people work towards energy in terms of sustainable ICT.

Therefore, The environmental and energy problem Kenya faces as far computer installations are concerned can be avoided​ by

  • Knowing and finding out the key aspect of ICT strength.
  • Create an holistic judgements in the assessment of ICT capability. Promote the use of solar power.

Learn more about computer installations from

brainly.com/question/11430725

#SPJ1

7 0
1 year ago
What are the disadvantages of having too many featuresin a language?
AlekseyPX

Answer:

Disadvantage of having too many features in a language is that:

  • There are many functions with same name but perform different function or task so it will create an issue or problem.
  • Features do not duplicate one another as, there are different possible syntax for the same meaning.
  • In a mathematical function, sometimes user function and mathematical variable name collide with language base features so it will create problem.
4 0
3 years ago
Other questions:
  • A network administrator is implementing dhcpv6 for the company. the administrator configures a router to send ra messages with m
    6·1 answer
  • Which of the following savings vehicles usually requires a high minimum balance? ASimple savings account BCertificate of Deposit
    7·1 answer
  • Which reading strategy refers to reading only the key words and phrases?
    13·2 answers
  • ________is a Windows software program with powerful accessibility solution that reads information on your screen using synthesiz
    9·1 answer
  • How we know that how many domain exist in window server 2012?
    14·1 answer
  • What do modern CPUs use to simulate the performance of multiple processors within one processor?
    9·2 answers
  • What is the most difficult part of working with the Help system?
    8·1 answer
  • How many passes will it take to find the four in this list? 4, 5, 6, 7, 8, 9, 10 1 2 3 4
    12·2 answers
  • Electronic mail is a
    9·1 answer
  • Design an algorithm to find the weighted average of four test scores. The four test scores and their respective weights are give
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!