The Rock, Paper, Scissors game rules are as follows: > If both the computer and the player pick the same (rock/paper/scissors), it is a tie > Rock beats scissors > Paper beats rock > Scissors beat paper Write a Python program (rockpaperscissors.py) that consist of three functions: > Main ➤ fComputerRPS (RPS = Rock Paper Scissors) > fDetermine Winner Import the random module into your program In function ComputerRPS do the following: > Use the random number generator to return one of "rock", "paper", or "scissors" In function main() do the following: > Print a welcome message to the user > Ask the user for their choice - rock/paper/scissors ➤ Perform input validation and only accept valid input, if validation fails, display input again (loop) > Call the fComputeRPS() function and save the returned "computer's choice" value in a variable ➤ Display the user's choice and the computer's choice (see output below) > Display the winner by calling function fDetermine Winner (see output below) > Ask the user whether they want to play again, accept lowercase and uppercase y as acceptable input o If yes, then call function main again In function fDetermine Winner do the following: > Define two input parameters, the user's choice and the computer's choice (Rock, Paper, or Scissors) > Based on the rules mentioned above, determine whether it is a tie, or whether the computer won or whether the player won Return a string summarizing the outcome of the game (this string will be displayed in function main), for example: o Computer wins (Paper beats Rock) or User wins (Rock beats Scissors)
The Rock, Paper, Scissors game rules are as follows: > If both the computer and the player pick the same (rock/paper/scissors), it is a tie > Rock beats scissors > Paper beats rock > Scissors beat paper Write a Python program (rockpaperscissors.py) that consist of three functions: > Main ➤ fComputerRPS (RPS = Rock Paper Scissors) > fDetermine Winner Import the random module into your program In function ComputerRPS do the following: > Use the random number generator to return one of "rock", "paper", or "scissors" In function main() do the following: > Print a welcome message to the user > Ask the user for their choice - rock/paper/scissors ➤ Perform input validation and only accept valid input, if validation fails, display input again (loop) > Call the fComputeRPS() function and save the returned "computer's choice" value in a variable ➤ Display the user's choice and the computer's choice (see output below) > Display the winner by calling function fDetermine Winner (see output below) > Ask the user whether they want to play again, accept lowercase and uppercase y as acceptable input o If yes, then call function main again In function fDetermine Winner do the following: > Define two input parameters, the user's choice and the computer's choice (Rock, Paper, or Scissors) > Based on the rules mentioned above, determine whether it is a tie, or whether the computer won or whether the player won Return a string summarizing the outcome of the game (this string will be displayed in function main), for example: o Computer wins (Paper beats Rock) or User wins (Rock beats Scissors)
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
pythojn please thank y
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education