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
................. are used to summarize data (option) (a) report (b) action ​
Tems11 [23]
I think it A I feel like report is right for the answer
5 0
3 years ago
Read 2 more answers
Which of the following events would most likely produce an earthquake
sveticcg [70]

Earthquakes are usually caused when rock underground suddenly breaks along a fault. This sudden release of energy causes the seismic waves that make the ground shake. When two blocks of rock or two plates are rubbing against each other, they stick a little. ... When the rocks break, the earthquake occurs.

8 0
3 years ago
The term phreaker is now commonly associated with an individual who cracks or removes software protection that is designed to pr
Colt1911 [192]
I believe the answer is B. False.

Hope this helps! ^^
7 0
2 years ago
Read 2 more answers
someone who protects valuable online information, like phone numbers and passwords would be considered​
charle [14.2K]

Answer: i believe a digital citizen

i am not 100% sure about that answer but i reaserached a little and thats what i found :)

I hope this helps u out a little a thank and a brainlist would be greatly appreciatecd :)

6 0
3 years ago
Is discord down right now?
Eva8 [605]

Answer:

yes it is

Explanation:

To do this, visit discord.com and login to the web version. Once logged in using the right credentials launch the app on your PC, discord should work properly now. Ensure the system is up to date. As a last resort, uninstall and reinstall the app again.

3 0
3 years ago
Other questions:
  • Which social media marketing concept engages visitors, getting them to revisit your website and tying them to offline events for
    7·2 answers
  • If some1 emails u and u want to know who it was how do u find that out
    10·2 answers
  • A type of VPN connection, where a single computer logs into a remote network and becomes, for all intents and purposes, a member
    13·1 answer
  • In ____________________ testing, security personnel simulate or perform specific and controlled attacks to compromise or disrupt
    10·1 answer
  • Use the function random.randint to write a program that rolls a 6-sided die 100 times, and prints out all of the rolls.
    8·1 answer
  • 3. Why is human resource plan made​
    11·1 answer
  • How i simplify this boolean expression ?A'.B'.C'+A'.B'.C+A'.B.C+A.B'.C+A.B.C
    6·2 answers
  • Keyshia wants to add movement to her PowerPoint presentation. Which tab should she use to complete this task
    15·2 answers
  • Please help me with these questions​
    12·2 answers
  • Why do meteorologists use data such as temperature, wind speed, and air
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!