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
The operating system is not directly involved in one of these tasks.Immersive Reader
Alex73 [517]
Displaying a web page
3 0
3 years ago
At the beginning of Section 5.2, it is stated that multiprogramming and multiprocessing present the same problems, with respect
QveST [7]

Answer:

By definition, <u>multiprocessing</u> refers to the processing of multiple processes at the same time by multiple CPUs.

By definition, <u>multiprogramming</u> keeps programs in main memory at the same time and execute them concurrently utilizing a single CPU doing a context switch.

The first difference is that multiprocessing uses multiple CPUs and multiprogramming to utilize context switch to do concurrency in one CPU. Another difference is that multiprocessing is more expensive but more efficient than multiprogramming due that it allows parallel processing.

6 0
3 years ago
Can someone help me plz
xxMikexx [17]

Answer:

ok but on what tho

Explanation:

plz explain yourself

8 0
3 years ago
Read 2 more answers
A city government is attempting to reduce the digital divide between groups with differing access to computing and the Internet.
sergeinik [125]

Answer:

C

Explanation:

Putting all government forms on the city web site is the least activity likely to be effective in the purpose of reducing digital divide.

Holding basic computer classes at the community centers will very much help to reduce the digital divide.

Providing free wireless internet connections at locations in low-income neighborhood will also reduce the gap of digital divide

Requiring that every city school has computers that meet a minimum hardware and software will made computing resources available to users thereby reducing digital divide.

5 0
3 years ago
Hi what is full form of ugst​
AURORKA [14]

Answer:

UGST – Union Territory Goods & Services Tax.

4 0
3 years ago
Read 2 more answers
Other questions:
  • When you declare an array, _____________________ You always reserve memory for it in the same statement You might reserve memory
    9·1 answer
  • When you use the bufferedreader class, you must import the ____ package into your program?
    14·1 answer
  • The Circle of Growth
    10·1 answer
  • Your network has had long power outages that have caused Hyper-V servers to shut down after the UPS battery is drained. When pow
    8·1 answer
  • How many address bits are needed to specify each byte in a 512 byte memory unit?
    5·1 answer
  • What part of the network is the point where the responsibility of the administrator ends and the telecommunications providers re
    5·1 answer
  • ________models software in terms similar to those that people use to describe real- world objects.
    6·1 answer
  • Explain why the process of sketching in engineering might resemble a loop or a cycle.
    15·2 answers
  • Explain the basic operations of a computer system​
    6·1 answer
  • A vlan ________.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!