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
soldier1979 [14.2K]
4 years ago
14

Write a statement that compares the values of score1 and score2 and takes the following actions. When score1 exceeds score2, the

message "player1 wins" is printed to standard out. When score2 exceeds score1, the message "player2 wins" is printed to standard out. In each case, the variables player1Wins,, player1Losses, player2Wins, and player2Losses,, are incremented when appropriate.
Finally, in the event of a tie, the message "tie" is printed and the variable tieCount is incremented.
So far this is what I have:
if score1>score2:
player1Wins=player1Wins+1
player2Losses=player2Losses+1
print("player1Wins")
elif score2>score1
player2Wins=player2Wins+1
player1Losses=player1Losses+1
print("player2Wins")
else:
score1=score2
tieCount=tieCount+1
print("tie")
___________________________
However, I'm still getting an error and not sure why. Am I indenting something wrong?
Computers and Technology
1 answer:
vaieri [72.5K]4 years ago
8 0

Answer:

player1Wins = player1Losses = player2Wins = player2Losses = tieCount = 0

score1 = 10

score2 = 10

if score1>score2:

   player1Wins=player1Wins+1

   player2Losses=player2Losses+1

   print("player1 wins")

elif score2>score1:

   player2Wins=player2Wins+1

   player1Losses=player1Losses+1

   print("player2 wins")

else:

   tieCount=tieCount+1

   print("tie")

Explanation:

Since your indentation can not be understand what you give us, please try to do it as you see in the answer part.

Although it seems that this is a part of the code, it is normal that you get errors. However, since you keep track of the variables, it is better to initialize the variables that will keep the counts. Since initially, they are 0, you may set them as 0. Also, if you assign the values to the scores, probably you would not get any error. This way, you may test your code as I did.

Other than these, in the else part you do not need to write "score1=score2", because if score1 is not greater than score2 and if score2 is not greater than score1, this already implies that they are equal

You might be interested in
What are business rules​
meriva

Answer:

defines or constrains some aspect of business and always resolves to either true or false. It specifically involves terms, facts and rules

Explanation:

5 0
3 years ago
Which disipline involves creating computer networks
Anestetic [448]

Answer:

computer science

The discipline of computer science includes the study of algorithms and data structures, computer and network design, modeling data and information processes, and artificial intelligence.

Explanation:

hope this helps

brainliest plz

5 0
3 years ago
Read 2 more answers
What at some advantages of creating a powerpoint?
Umnica [9.8K]
 <span>A power point presentation is designed as a presentation tool for any individual that needs to present information in a basic or through the use of a template and/or animated sequences with the flow of information, whether images, [ or text boxes as well as sound if speakers are present; all of which is used to make it more interesting and convey to people. Power point is used for all types of reasons, either for a selling tool such as sales & marketing; academic presentation of certain tasks and pieces of research, et cetera. it can be exported to a PDF or another format to allow further manipulation; it can be saved as a package onto a CD/DVD if you are submitted the presentation by disc. Depending on the version you use, you can customise the way you can present the information itself. Due to the flexibility of the application, if you are for instance using another graphic application to create images and special effects; you can normally drag and drop the content straight into the program without having to import it through the File menu options of Power Point, but again it depends on the version.</span>
8 0
3 years ago
Hoda wants to create a new presentation in PowerPoint with existing graphics and designs. What is the easiest and fastest way fo
Paul [167]

Answer: a

Explanation:

6 0
4 years ago
Define the term entity and give an example of an entity .
Norma-Jean [14]

Explanation:

This term is used in programming languages/concepts, database management, systems design, etc. It's defined as a singular, identifiable and separate object, a thing of interest to an organization, system or individual about which data is to be held. Each of these entities have attributes (properties or characteristics) and can be considered as separate wholes.

Some examples of entities are:

  • In a system: discrete or separate components
  • In general, users, components and organizations.

I hope you find this information useful and interesting! Good luck!

3 0
3 years ago
Other questions:
  • ​_____ describes the process of using computer software to extract large amounts of data from websites. A. Sentiment analysis B.
    10·1 answer
  • You want to arrange 6 of your favorite CD's along a shelf. How many different ways can you arrange the CD's assuming that the or
    15·1 answer
  • You work at a computer repair store. You just upgraded the processor (CPU) in a customer's computer. The computer starts, but it
    11·2 answers
  • The general manager for a retail clothing outlet was recently cited as saying, IT is the cornerstone of our company. All of our
    9·1 answer
  • Describe the use of technology in the promotional function
    5·2 answers
  • Gmod how to make someone admin on a lan server
    6·2 answers
  • How can I do a project with a model on the steam machine?
    14·1 answer
  • Which of the following is NOT an international organization?
    13·1 answer
  • Plz help need answers!???idk if u can zoom
    13·1 answer
  • Write a program, TwoDimentionalGrid. Ask the user to enter the size of the 2 dimensional array. Here we are not doing any input
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!