We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
# RocksPapersScissors
“Rock paper scissors” is a simple and interesting game. Many of us used to play it in a school to resolve disputes or just to spend some time.
RULES: The rules are very simple and probably you remember them from your childhood:
-> If you choose Rock, you will win against Scissors but lose against Paper.
-> If you choose Scissors, you will win against Paper but lose against Rock.
-> If you choose Paper, you will win against Rock but lose against Scissors.
Originally posted by @PavanCheruvupally in #448 (review)
The text was updated successfully, but these errors were encountered:
import random
game = True
score = 0
valid_inputs = ["rock", "paper", "scissors"]
print("Welcome to Rock. Paper, Scissors. Let's play best 2 of 3")
while game is True: while -2 < score < 2: print("The score is ", score) player_choice = input("Choose: Rock, Paper, Scissors: ").lower() if player_choice in valid_inputs: computer_choice = valid_inputs[random.randint(0, 2)] print("The computer chose " + computer_choice + ".") if player_choice == computer_choice: print("Tie! Try again.") else: if computer_choice == "scissors": if player_choice == "rock": print("The computer got you!") score -= 1 else: print("You got the computer!") score += 1 elif computer_choice == "rock": if player_choice == "paper": print("The computer got you!") score -= 1 else: print("You got the computer!") score += 1 elif computer_choice == "paper": if player_choice == "scissors": print("The computer got you!") score -= 1 else: print("You got the computer!") score += 1
else: print("Invalid input, Please try again.") else: print("Game over!") if score == 2: print("You win!") else: print("You lose!") game = False
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
“Rock paper scissors” is a simple and interesting game. Many of us used to play it in a school to resolve disputes or just to spend some time.
RULES: The rules are very simple and probably you remember them from your childhood:
-> If you choose Rock, you will win against Scissors but lose against Paper.
-> If you choose Scissors, you will win against Paper but lose against Rock.
-> If you choose Paper, you will win against Rock but lose against Scissors.
Originally posted by @PavanCheruvupally in #448 (review)
The text was updated successfully, but these errors were encountered: