Question
PLEASE WRITE CODE IN PYTHONG: Objective: To play the rock-paper-scissors game. This program should play one game of the rock-paper-scissors game, which is where each
PLEASE WRITE CODE IN PYTHONG:
Objective: To play the rock-paper-scissors game.
This program should play one game of the rock-paper-scissors game, which is where each player picks either rock, paper, or scissors, and then one of the following happen:
Rock breaks scissors
Paper covers rock
Scissors cut paper
There is a tie (both players picked the same thing)
If the user enters invalid input, your program should say so, otherwise it will output one of the above results. You should randomly generate a number to determine the computer's move.
Here are the rules:
Your program should be able to handle input of capital or lower-case letters (Both 'R' and 'r' mean "Rock")
You should use at least one multi-way if-statement (using "elif").
You should use at least one logical AND or OR in your program.
You should always output who won (unless there's a tie).
SAMPLE OUTPUT:
Here is some sample output Sample 1 Run -[Not part of the official output] Please enter your move: ('P' for Paper, R' for Rock, '' for Scissors)r Computer's move is Scissors You Win! Rock Breaks Scissors!! Sample 2 Run [Not part of the official output] Please enter your move: ("P' for Paper, 'R' for Rock, 'S' for Scissors) R Computer's move is Paper Computer Wins! Paper Covers Rock!! -Sample 3 Run [Not part of the official output] Please enter your move: ("P' for Paper, R' for Rock, 'S' for Scissors)r Computer's move is Rock Tie!! Sample 4 Run [Not part of the official output] Please enter your move: ('P' for Paper, R' for Rock, 'S' for Scissors)p Computer's move is Paper Tie!! Sample 5 Run [Not part of the official output] Please enter your move: ('P' for Paper, R' for Rock, 'S' for Scissors)x Computer's move is Scissors Invalid move!! -Sample 6 Run -[Not part of the official output] Please enter your move: ("P' for Paper, 'R' for Rock, 'S' for Scissors) s Computer's move is Paper You Win! Scissors Cut Paper!! Sample 7 Run [Not part of the official output] Please enter your move: ("P' for Paper, R' for Rock, 'S' for Scissors)p Computer's move is Rock You Win! Paper Covers Rock
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started