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 15:30
In a compound condition, both conditions on either side of the logical operator and must be true for the overall condition to be true. a: true b: false
Answers: 1
question
Computers and Technology, 24.06.2019 16:30
Which program can damage your computer?
Answers: 1
question
Computers and Technology, 24.06.2019 18:30
Jacking is a crime that takes place when a hacker misdirects url to a different site. the link itself looks safe, but the user is directed to an unsafe page
Answers: 1
question
Computers and Technology, 24.06.2019 22:30
In writing a paper for his english class, gavin quoted an author of the book. what should he include in his paper to credit the source? citation caption header entry
Answers: 1
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, 18.03.2021 22:20
question
Mathematics, 18.03.2021 22:20
question
History, 18.03.2021 22:20
question
Mathematics, 18.03.2021 22:20