Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions

Question

What is a verb?

Answered: 1 week ago

Question

The amount of work I am asked to do is reasonable.

Answered: 1 week ago

Question

The company encourages a balance between work and personal life.

Answered: 1 week ago