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]
3 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]3 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
An___ is a rectangular work area in the desk top that contains a program, text, files, it other data and tools.
Nataly_w [17]
A window is a rectangular work area in the desk top that contains a program, text, files, it other data and tools.
Hope this helps!
5 0
3 years ago
To what health hazard are people working in offices most likely to be exposed.
Andrei [34K]

Answer:

Sickness

Explanation:

6 0
3 years ago
ASAP Please Answer Question Within 5 Minutes! OSI is a reference system used by most types of technicians EXCEPT. Answer: Engine
likoan [24]

Answer:

Technical Illustrator do not use ISO reference model in their work. They often use graphical and visual drawing tools of technical illustration in their work. However, Network engineer and computer scientist  often used ISO reference model in their work. As you know that, ISO is a standard for protocol used for communication between two computers.

Explanation:

Technical Illustrator

A technical illustrator makes illustration and visual representation of a product in order to communicate technical information of technical nature with customer/user. The technical illustrator illustrates the technical presentation of the product in manuals and in publication. However, the technical illustrator doesn’t use the ISO model in their work. They use graphical and visual tools to help their work effectively.

Engineer:

Network engineers, communication and internet engineers use the ISO model. For example, if any fault occurs in LAN, to diagnose the fault, the network engineer uses the ISO model to identify the error in ISO layers. They use the ISO conceptual model, in order to know which layer is producing the fault.

Computer Scientists:

The computer scientist who is working in the field of telecommunication, they often use the ISO model as a base, to make improvement in the communication system and management of telecommunication system.

7 0
3 years ago
Read 2 more answers
What method of technical drawing uses converging lines?
lana [24]

Answer:

one-point perspective?

Explanation:

i think this is correct, tell me if it's not

5 0
3 years ago
What does the Simplify command do?
Margaret [11]
If you're talking about MATLAB, the simplify command performs an algebraic simplification within the given parameters in the parenthesis. You can use the command simplify on polynomials, expressions with trigonometric, logarithmic, and special functions. For example the following expression simplify(cos(0)) would return 1. 
3 0
3 years ago
Other questions:
  • If you enter 234.567 into a cell that is formatted to display 1 decimal point place, what is the value stored in the cell
    9·1 answer
  • ________ is the application of statistical techniques to find patterns and relationships among data for classification and predi
    14·1 answer
  • When you right-click certain areas of the Word or other Office app windows, a command menu will appear. Group of answer choices
    13·1 answer
  • Presses the Schedulr app icon Selects the list item for CSCI 448 Presses the "View Classroom on Map" button While only performin
    11·1 answer
  • Which wireless communication is typically limited to six feet of distance?
    6·1 answer
  • Give three reasons why you think Clip Art is so widely used in many different types of documents.
    13·2 answers
  • It is important to know the terms of use of any website because why
    12·2 answers
  • Which components exist in the contextual tab for tables called Design? Check all that apply.
    15·2 answers
  • How can a robot differentiate between positive or negative product reviews?
    14·1 answer
  • The domain name system ________. Question 2 options: A) is a way to find a host's IP addresses if your computer only knows the h
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!