subject

# I need help with my python code, it won't work, and no matter what I try, I can't get it to run properly. Every time I try top run it, it gives me an error saying: # syntaxError, bad input on line 43, I am not very good at programming, and I just started. I wanted to ask if you guys could help me.
# Here's my code, the purpose of it is to be a rock paper scissors game:

```
import random

def welcome_prompt():
print ("Rock paper Scissors game")
print ("Rules: Rocks beats Scissors, Scissors beats Paper, Paper beats Rock")

def get_player_move():
print ('Round ' + str(round))
print ("Please play one of the following")
move = raw_input(" 1) [R]ock, 2) [P]aper, 3) [S]cissors:")

if get_player_move == ("R"):
print ("You used Rock!")
return 1
elif get_player_move == ("P"):
print ("You used Paper!")
return 2
elif get_player_move == ("S"):
print ("You used Scissors!")
return 3
else:
print "Invalid input, please use capitalized initial (R, P,S)"
return get_player_move()

def get_computer_move():
get_computer_move = random. randint(1,3)

if get_computer_move == 1:
print ("Computer used Rock!")
return 1
elif get_computer_move == 2:
print ("Computer used Paper!")
return 2
elif get_computer_move == 3:
print ("Computer used Scissors!")
return 3

def compare_moves(get_player_move, get_computer_move):

if (get_player_move == 1 and get_computer_move == 1) or (get_player_move
== 2 and get_computer_move == 2) or (get_player_move == 3 and
get_computer_move == 3):
print ("It's a tie!")
return 0

elif (get_player_move == 1 and get_computer_move == 3) or
(get_player_move == 2 and get_computer_move == 1) or (get_player_move ==
3 and get_computer_move == 2):
print ("You win the round!")
return 1

elif (get_player_move == 1 and get_computer_move == 2) or
(get_player_move == 2 and get_computer_move == 3) or (get_player_move ==
3 and get_computer_move == 1):
print ("You lose the round!")
return -1

elif (get_player_move == 4):
print ("You didn't put in correct input, computer gets a free win")
return -1

player_score = 0
comp_score = 0
round = 0

welcome_prompt()

('Round ' + str(round))
while round< 10:
round = round + 1
get_player_move()
get_computer_move()
compare_moves(get_player_move, get_computer_move)

if compare_moves == 1:
player_score = player_score + 1
print 'Player Score'+ str(player_score)
print 'Computer Score'+ str(player_score)
elif compare_moves == -1:
comp_score = comp_score + 1
print 'Player Score'+ str(player_score)
print 'Computer Score'+ str(player_score)

print ("Game Over")

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:00
Which type of tab stop is most for weights and measurements?
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
What provides an array of buttons for quick access to commonly used commands and tools
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Visually impaired individuals generally rely on the for navigation. thus, designers need to ensure that mouse-specific inputs, such as pointing, clicking, and hovering, can be done without a mouse.
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
How do i get rid of my member ship for
Answers: 2
You know the right answer?
# I need help with my python code, it won't work, and no matter what I try, I can't get it to run pr...
Questions
question
English, 08.01.2021 19:00
question
Social Studies, 08.01.2021 19:00
question
Mathematics, 08.01.2021 19:00
question
Mathematics, 08.01.2021 19:00
question
Mathematics, 08.01.2021 19:00
question
Mathematics, 08.01.2021 19:00
Questions on the website: 13722361