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
How does a Cloud-first strategy approach a client's migration to the Cloud?by removing outside ecosystem partners from the Cloud
belka [17]

Cloud-first strategies are <em>operating methods</em> wherein teams move all or most of their infrastructure to <em>cloud computing systems</em><em>  </em>such as Web Services, and the further discussion can be defined as follows:

  • It stores assets, including quest and <em>secure resources</em>, in the cloud rather than employing <em>physical resources</em> including such server clusters.
  • This approaches a client's migration to the <em>Cloud by integrating multiple services </em>together to serve the client's business needs.

Therefore, the final answer is "Last choice".

Learn more:

brainly.com/question/1256812

3 0
2 years ago
________ is an open-source program supported by the Apache Foundation that manages thousands of computers and implements MapRedu
coldgirl [10]

Answer:

Hadoop.

Explanation:

Apache Hadoop:- Supported by Apache foundation it is an open-source framework created for processing very large data sets.

Apache Hadoop consists of components including:

MapReduce for parallel processing.

(HDFS) Hadoop Distributed File System.

Yarn for cluster resource managementand job scheduling.

Common libraries needed by the other Hadoop subsystems.

5 0
3 years ago
Which of these statements about tags is false?
Elenna [48]

Answer:

LOL i don't even know

Explanation:

3 0
3 years ago
Look act the picture
VLD [36.1K]

Answer:

the answer is b

Explanation:

3 0
3 years ago
HELPPPPP 20 POINTS CORRECT ANSWER GETS BRAINLIEST<br>sorry wrong amount of points ;-;
Vinvika [58]

Answer:

C

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • Write a recursive, bool-valued function, containsVowel, that accepts a string and returns true if the string contains a vowel. A
    5·1 answer
  • True / False<br> 1. A byte is a standardized unit of measure that is always 8-bits.
    7·1 answer
  • Upon looking out at the
    8·2 answers
  • With Voice over Internet Protocol (VoIP), _____. a. voicemails cannot be received on the computer b. call quality is significant
    6·1 answer
  • [This is on Edhesive (coding and programming)]
    8·2 answers
  • This is a program that calculates information about orders of shirts and pants. All orders have a quantity and a color. Write a
    7·1 answer
  • Lee has changed the style of his table to make the header row stand out. Next, he wants to center the text in the header row and
    11·2 answers
  • Sharl downloads images from an online library and uses them in her work. The images are shared under the Creative Commons Attrib
    13·1 answer
  • On a Windows system, which Task Manager tab would you use to adjust the priority given to a specific program
    13·1 answer
  • [80 points] Fill in the missing word.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!