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, 21.06.2019 22:00
Matlab question: use switch and anythe lottery game matches three different integer numbers between 1 and 10. winning depends on how many matching numbers are provided by a player. the player provides three different integers between 1 and 10.if there is a match of all 3 numbers, the winning $ 1000.if there is a match with 2 numbers, the winning $ 10.if there is a match of all with 1 numbers, the winning $ 1.with no match, the winning is $0.write a function lottery3 that checks three numbers provided by a player and determine the winning amount. if the user mistakenly enters same number twice/thrice and if that number matches one of the winning numbers, the code should count that number only once and display correct result. the player doesn’t have to guess the order of numbers.the input to the function lottery3 can have up to two input arguments. the first input argument is a row array numbers with 3 numbers. if the second argument input testcode is present, and is a row vector of 3 values, the function lottery3 uses the code in testcode as the three winning numbers (the test must be three different integer numbers between 1 and 10), else three different numbers will be automatically generated by testcode.the ouput should return the variable winnings and the three winning numbers in the row array winnumbers.hint: make use of the internal function any.restriction: the function must use switch-case statements to determine the winning.example #1: winning = lottery3( [1,2,1],[1,2,3])produceswinning =10example #2: [winning,winnumbers] = lottery3( [1,2,3])produceswinning =3winnumbers =8 5 3
Answers: 1
question
Computers and Technology, 22.06.2019 04:30
Dr. wisteria is a prominent chiropractor in the chicago area. she wants to provide a forum for her patients to discuss their health concerns and to seek and offer advice to other patients. which telecommunications tool is most appropriate for dr. wisteria's needs?
Answers: 3
question
Computers and Technology, 22.06.2019 12:10
Linux is distributed under gnu gpl. why is this important? a. it ensures that only torvalds can profit from the sale of linux b. it prevents unknowledgeable users from downloading programs they don't know how to operate. c. it provides protection for the developers who created linux. d. it states that anyone can copy, modify, and share the program if changes are made public.
Answers: 1
question
Computers and Technology, 22.06.2019 16:30
The most common battery cable terminal is a that provides a large surface contact area with the ability to tighten the terminal onto the battery post using a nut and bolt.
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
Questions on the website: 13722363