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 possible consequences for cyberbullying?
MrRa [10]

Answer:

Victims of cyberbullying are more likely than their peers to abuse alcohol and drugs, have physical and emotional health issues, and may suffer from low self-esteem. Poor grades in school is another consequence of cyberbullying that can also be accompanied by an attempt by the victim to avoid other children by refusing to go to school.

Explanation:

8 0
3 years ago
Read 2 more answers
_____is detection of events within a given set of parameters, such as within a given time period or outside a given time period.
dybincka [34]

<u>Windowing</u> is the detection of events that fall inside a specified set of parameters, such as within or outside of a specified time frame.

<h3>What is windowing?</h3>

Windowing is the process of processing and analysing a small subset of a bigger dataset. The rectangular window is a crude method that merely truncates the dataset before and after the window without altering the contents of the window in any way.

A windowing system allows many apps to simultaneously share a computer's graphical display presentation resources. You might want to utilise several programmes simultaneously on a computer with a graphical user interface (GUI) (this is called task).

Therefore, windowing is detection of events within a given set of parameters, such as within a given time period or outside a given time period.

To know more about Graphucal user interface, visit: brainly.com/question/14758410

#SPJ4

7 0
2 years ago
An application that can be launched from my web browser is known as a _____. java applet spreadsheet cad software music applicat
SIZIF [17.4K]
An application that can be launched from my web browser is known as a java applet. Java applet is a <span>small application which users can launch from a web-page, that clearly coincides with the statement in the task. As you can see, java is the most appropriate word for the gap.
Regards.</span>
4 0
3 years ago
Https://meetme.bit.nl/OfficialTrapstarz Join yall its my birthday
laila [671]

Answer:

HAPPY BIRTHDAY EVEN THO WE JUST MET

5 0
3 years ago
Read 2 more answers
Help ASAP please ?
mylen [45]
Okay, so since I don't completely understand your question, I'll just try my best to explain each of them.

1. Someone can find your location based on a photo that you posted; If you tagged the location, obviously they can find the location. If you put in the caption where you were when you took the photo, again yes, they would be able to find the location. If you were in a well known location when you took the picture and you can clearly see the background or the setting, with context clues you can figure it out, but as far as the social media platform telling the public where the picture was taken or posted, it is not authorized to give out the location.

2. Colleges use social media during the admission process; Some colleges do check the social media, not all but some. Mostly the platforms where you are most careless, so watch out. You can decide if you want your account to be public or private in the account settings.

3. items posted online can be removed at anytime; yes it can be removed, but depending on how popular the post was, people will still remember it.

4. Things you post online become public information; yes and no. On any and all social media platforms, there is a setting where you can choose the audiences the post reaches. There is the public setting where it's completely public and out into the world, there is the privacy setting where you are the only one who can view it, there is the friends setting where your friends can view your posts, and on some there are the friends/followers except... where you can choose specific people that can't view your post/s, and finally there is the specific friends that can view the post. You can also decide if you want your account in general to be public or private, which you can go into the settings and decide.

5. Employers screen job candidates based on social medias; like number 2 up there, some employers do check your social medias, but if you have you account settings as private they will have to request access.

I hope I helped at least a little! If I didn't i'm sorry i didn't completely understand the question so I tried my best.
If I did help, I'd appreciate it if you would give me brainliest! Thank you!
5 0
3 years ago
Read 2 more answers
Other questions:
  • Web design people please help!
    7·1 answer
  • Which type of view is created from the following SQL statement? CREATE VIEW balancedue AS SELECT customer#, order#, SUM(quantity
    15·1 answer
  • A printer is connected locally on Computer1 and is shared on the network. Computer2 installs the shared printer and connects to
    10·1 answer
  • The internet shopping cart is an example of which version of the web?
    11·1 answer
  • Match the title of the work of fiction to the description given.
    8·1 answer
  • The process of recording and reporting the financial data for a business is known as:
    6·2 answers
  • Answer this crossword for brainliest and 15 points
    9·1 answer
  • Simple example of hybrid computer​
    7·2 answers
  • What does this mean startUp()
    13·1 answer
  • Game Design!
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!