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
Select all the correct answers
ikadub [295]
Umm I think 3 and 1
5 0
2 years ago
COMO HA SIDO LA INNOVACION DE ESTE OBJETO TECNOLOGICO DURANTE SU EVOLUCIÓN
Marizza181 [45]

Answer:

Cual es el objeto tecnologico?

Explanation:

Si dices Cual,puede ser que te ayude.

3 0
3 years ago
This is a bit confusing to me. Could someone please help me! I have to use CSS to Design a Web Page. I will mark Brainliest!
GrogVix [38]

Answer:

CSS is easy

Explanation:

CSS is like the color or your sylte for a webpage.

6 0
3 years ago
What kinds of online behaviors could be considered cyberbullying?
morpeh [17]

Answer:

anxiety, fear, depression, and low self-esteem. or flaming it refers to an online fight exchanged via emails, instant messaging or chat rooms. It is a type of public bullying that often directs harsh languages, or images to a specific person.

Explanation:

5 0
3 years ago
Read 2 more answers
By default, the windows desktop display
MrRissso [65]
By default, the windows desktop display the following icons/programs

1. Your Recycle Bin
2. My Computer
3. The Internet Explorer
4. The default Windows Background
5. Your windows menu
6. My Documents
7. Your task bar
8. Time (located at bottom right)
6 0
3 years ago
Other questions:
  • If a cache access requires one clock cycle and dealing with cache misses requires an additional five clock cycles, which of the
    9·1 answer
  • On Brainly, how can I change my username? from halfsidepancake​
    6·2 answers
  • The syntax for accessing a class (struct) member using the operator -> is ____.
    15·2 answers
  • An extranet is like an intranet except that it allows company employees access to corporate Web sites from the ______
    13·1 answer
  • The domain name service (dns is a distributed database that allows users to communicate with each other computers by:
    7·1 answer
  • Which of the following statements is true?A)Implicit data type conversion is performed when you mix values of different data typ
    5·1 answer
  • What of the following is not a benefit of active listening
    8·2 answers
  • How do I keep my computer and data safe and secure while using the Internet?
    14·2 answers
  • Bonjour ma question est: expliquer comment fonctionne une calculatrice qui ne contient pas une pile. Pouvez-vous m'aider?
    12·1 answer
  • Why can't this app have people ask riddles.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!