I need the create a Python code that makes a two-player Rock-Paper-Scissors game. (Hint: Ask for player plays (using input), compare them, print out a message of congratulations to the winner, and ask if the players want to start a new game)
Please help me see why my "continue" is asking the players to start a new game.
Here is my code;
user1= input("Whats your name? ")
user2= input("And your name? ")
a = input("%s, do yo want to choose rock, paper or scissors? " %
user1)
b = input("%s, do you want to choose rock, paper or scissors? " %
user2)
def compare(a, b):
if a=='rock':
if b=='rock':
return"Tie"
if str(input('Do you want to play another game, yes or no?\n')) ==
'yes':
continue
else:
print('Game Over.')
break
elif b=='paper':
return "paper wins"
if str(input('Do you want to play another game, yes or no?\n')) ==
'yes':
continue
else:
print('Game Over.')
break
elif b=='scissors':
return"rock wins"
if str(input('Do you want to play another game, yes or no?\n')) ==
'yes':
continue
else:
print('Game Over.')
break
elif a=='paper':
if b=='rock':
return"paper wins"
if str(input('Do you want to play another game, yes or no?\n')) ==
'yes':
continue
else:
print('Game Over.')
break
elif b=='paper':
return "tie"
if str(input('Do you want to play another game, yes or no?\n')) ==
'yes':
continue
else:
print('Game Over.')
break
elif b=='scissors':
return"scissors wins"
if str(input('Do you want to play another game, yes or no?\n')) ==
'yes':
continue
else:
print('Game Over.')
break
elif a=='scissors':
if b=='rock':
return"rock wins"
if str(input('Do you want to play another game, yes or no?\n')) ==
'yes':
continue
else:
print('Game Over.')
break
elif b=='paper':
return "scissors wins"
if str(input('Do you want to play another game, yes or no?\n')) ==
'yes':
continue
else:
print('Game Over.')
break
elif b=='scissors':
return"tie"
if str(input('Do you want to play another game, yes or no?\n')) ==
'yes':
continue
else:
print('Game Over.')
break
print(compare(a,b))
Program:
def compare(a, b):
if a == 'rock':
if b == 'rock':
return
"Tie"
elif b == 'paper':
return "paper
wins"
elif b == 'scissors':
return "rock
wins"
elif a == 'paper':
if b == 'rock':
return "paper
wins"
elif b == 'paper':
return
"Tie"
elif b == 'scissors':
return "scissors
wins"
elif a == 'scissors':
if b == 'rock':
return "rock
wins"
elif b == 'paper':
return "scissor
wins"
elif b == 'scissors':
return
"Tie"
user1= input("Whats your name? ")
user2= input("And your name? ")
while True:
a = input("%s, do yo want to choose rock, paper or
scissors? " % user1)
b = input("%s, do you want to choose rock, paper or
scissors? " % user2)
print(compare(a,b))
if str(input('Do you want to play another game, yes or
no?\n')) != 'yes':
print("Game Over.")
break
Execution and Output:

Please find the modified code below.
CODE
def compare():
while True:
user1= input("Whats your name? ")
user2= input("And your name? ")
a = input("%s, do yo want to choose rock, paper or scissors? " % user1)
b = input("%s, do you want to choose rock, paper or scissors? " % user2)
if a=='rock':
if b=='rock':
print ("Tie")
elif b=='paper':
print ("paper wins")
elif b=='scissors':
print ("rock wins")
elif a=='paper':
if b=='rock':
print ("paper wins")
elif b=='paper':
print ( "tie")
elif b=='scissors':
print ("scissors wins")
elif a=='scissors':
if b=='rock':
print ("rock wins")
elif b=='paper':
print ( "scissors wins")
elif b=='scissors':
print ("tie")
cont = input('Do you want to play another game, yes or no?\n')
if cont.lower() != 'yes':
print('Game Over.')
break
compare()



I need the create a Python code that makes a two-player Rock-Paper-Scissors game. (Hint: Ask for...
Create a python program to play rock paper scissors using a while loop and if statements. I have started but have gotten stuck in a continuous loop. Please look over my code and help me find where I went wrong. Here it is: import random #Choice weapons=['Rock' ,'Paper' ,'Scissors'] print('Rock, Paper, Scissors!') print('Rock, Paper, Scissors!') print('Shoot!') human=input('Choose Rock, Paper, Scissors, or Quit! ') print('')#Blank Line while human != 'Quit': human_choice=human computer=random.choice(weapons) print(computer) if human==computer: print("It's a tie!") elif human=='Rock': if...
Python Language: Please see program listed below of a game called: Rock, Paper, Scissors. Please add an exception, for example if the user inputs something else other than rock, paper or scissors, the exception will print message: "Enter only rock, paper, or scissors". Also add option to keep playing the game, for example: print: "Would you like to play again? Enter Y or N". If the user says Y, the game will repeat, if N, the game will end and...
Write a Python program (rock_paper_scissors.py) that allows two players play the game rock paper scissors. Remember the rules: 1. Rock beats scissors 2. Scissors beats paper 3. Paper beats rock The program should ask the users for their names, then ask them for their picks (rock, paper or scissors). After that, the program should print the winner's name. Note, the players may pick the same thing, in this case the program should say it's tie. when the user input an...
Create the second part of a Rock, Paper, Scissors game. The game keeps playing as long as the user enters 'Y'. Make this case sensitive; if they enter a lower case y the game will not continue. If the user enters in anything besides upper case Y the game will end. Your text must exactly match the examples below: Example 1 with correct input Let's play Rock, Paper, Scissors Enter 1 for rock, 2 for paper, 3 for scissors 2...
java pls
Rock Paper Scissors Lizard Spock Rock Paper Scissors Lizard Spock is a variation of the common game Rock Paper Scissors that is often used to pass time (or sometimes to make decisions.) The rules of the game are outlined below: • • Scissors cuts Paper Paper covers Rock Rock crushes Lizard Lizard poisons Spock Spock smashes Scissors Scissors decapitates Lizard Lizard eats Paper Paper disproves Spock Spock vaporizes Rock Rock crushes Scissors Write a program that simulates the...
C++ Write a program that plays the rock, paper, scissors game. Rock beats scissors; scissors beats paper; paper beats rock. You must use these specific functions in your program. These are the prototypes: char generateP2toss(); int checkThrow(char, char); void printStatistics(int, int, int, int); void finalStatistics(int, int, int, int); void welcome(); Notes on these functions: generateP2toss() will generate the computer's toss (the computer is player2). It returns either an "r", "p", or "s/" checkThrow(char char) will check the throw by passing...
JAVA Beginnings of a paper-rock-scissors game. Paper-rock-scissors is a game often used to make decisions. There are two players. Each player secretly chooses either, paper, rock or scissors. At the count of three, each player reveals what they have chosen. The winner of the game is determined this way: paper beats rock (because paper covers rock) rock beats scissors (because rock crushes scissors) scissors beat paper (because scissors cut paper) If the two players choose the same item, it is...
In this problem, you’ll play a simple rock, paper, scissors game. First, you’ll ask the user to pick rock, paper, or scissors. Then, you’ll have the computer randomly choose one of the options. After that, print out the winner! You should keep playing the game until the user hits enter. Note: You’ll need to implement a method called String getWinner(String user, String computer). Luckily, you just wrote that in an earlier program! Here is a sample run of the program....
This program should be in c++. Rock Paper Scissors: This game is played by children and adults and is popular all over the world. Apart from being a game played to pass time, the game is usually played in situations where something has to be chosen. It is similar in that way to other games like flipping the coin, throwing dice or drawing straws. There is no room for cheating or for knowing what the other person is going to...
Using python 3.7.3 Challenge: Rock, Paper, Scissors GamePDF Description: Create a menu-driven rock, paper, scissors game in Python 3 that a user plays against the computer with the ability to save and load a game and its associated play statistics. Purpose: The purpose of this challenge is to assess the developer’s ability to create an interactive application with data persistence in Python 3. Requirements: Create a Rock, Paper, Scissors game in Python named rps.py according to the requirements specified in...