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
Tatiana [17]
3 years ago
11

i need to also do a algorithm where if the total is a even number 10 points are added to the score and if the total is odd then

5 points are subtracted. i have the part about the 10+ or 5- but im not sure how to do the even or odd number variable. help would be appreciated :) (im using python)
Computers and Technology
1 answer:
algol [13]3 years ago
5 0

Answer:

def UpdateScore(score, total):

   if total % 2:

       print total, "is odd, so adding 10"

       score += 10

   else:

       print total, "is even, so subtracting 5"

       score -= 5

   print "The score is now",score

   return score

score = 0

score = UpdateScore(score, 3)

score = UpdateScore(score, 6)

Explanation:

The % operator returns the remainder after division. So if you divide by 2, the remainder is either 0 or 1, where 0 indicates an even number, and 1 indicates an odd number. The above program shows that.

You might be interested in
2. You are developing a new application that optimizes the processing of a warehouse’s operations. When the products arrive, the
KonstantinChe [14]

Answer:

Option d) is correct

Explanation:

To optimize the processing of a warehouse’s operations, products are stored on warehouse racks when they arrive. The items that arrive last are the first to go out to minimize the time it takes to retrieve an item. The items that arrive need to be represented and the warehouse should be left in a data structure. The data structure which should you use to represent this situation is a queue.

Option d) is correct

5 0
3 years ago
What is software??????​??????????????????
larisa [96]

Answer:

<h3>Defination of Software :- </h3>

  • software, instructions that tell a computer what to do. Software comprises the entire set of programs, procedures, and routines associated with the operation of a computer system. The term was coined to differentiate these instructions from hardware.
  • The physical components of a computer system.

Explanation:

<h3>Hope this helps you dear ✌️</h3><h2>Carry on learning !! </h2>

4 0
3 years ago
Read 2 more answers
When is a handrail required for stairs
ch4aika [34]

Answer: when is not able to get up the stairs like a normal person

Explanation:

5 0
3 years ago
Read 2 more answers
57. Tammy's income for the month of January was $2,475. Her fixed expenses during that same
Roman55 [17]

Answer:

57. Tammy's income for the month of January was $2,475. Her fixed expenses during that same

month were $750, and her variable expenses totaled $1,750. What was Tammy's net cash flow

during the month of January? Be sure to indicate whether she had a surplus or a deficit.

Explanation:

no clue

5 0
3 years ago
Directions. Read and analyze the sentences below. There are words or phrases to be corrected. Rewrite it on the blank accrording
devlian [24]

Full question attached

Answer and Explanation:

1. There’s need to ask for help and advice from people who have the

knowledge and skills in making a simple electrical gadget.

2. Adapter is used to plug appliances that are far from the main power source.

3. Do not touch the metal pipes while you are doing electrical repairs.

4. Shut off the power at the main switch or circuit breaker and unplug the equipment when working on electricity.

5. Pliers are tools used to grip, pull or cut electric wires.

From the above, we have corrected some of the errors that could be made in everyday home appliances or home electricity. In number 4, it is also worthy of note that shutting off power at the main switch will only require emergency situations otherwise we need only shut off the one for the problem circuit and leave the rest.

5 0
3 years ago
Other questions:
  • Code Example 4-3 main program: import arithmetic as a def main(): num1 = 5 num2 = 6 result = a.add(num1, num2) print("The sum is
    15·1 answer
  • Type the correct answer in the box.
    7·1 answer
  • Many professional photographers take pictures of people. What skills would someone have to have to be successful in these types
    13·1 answer
  • What is an implicit benefit to Monetary Policy?
    6·1 answer
  • Which of the following is true regarding a class and interface types? Group of answer choices You can convert from a class type
    9·1 answer
  • In what country was the English royal family and nobility living before the Restoration?
    6·1 answer
  • To update a bibliography field that is not contained in a ____, right-click the bibliography, and then click Update Field on the
    10·1 answer
  • Which statement best describes the difference between a spreadsheet and a database?
    9·2 answers
  • ITING THE ANSWER
    9·1 answer
  • How many questions do you have to answer before you can use direct messages on Brainly?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!