Question: 2. Write a program to implement a rock paper scissors game using your algorithm from HW 1. Step1: import random module Step2: Display welcome message

2. Write a program to implement a rock paper scissors game using your algorithm from HW 1.

Step1: import random module

Step2: Display welcome message and rules of the game play

Step 3: set win_count and total_count zero

Step4: Display user selection choice 1. Rock 2. Paper 3. Scissor

Step5: If user does not select from options in step 4 generate error message. Ask for re -enter until correct choice.

Step6: Computer randomly choses one choice

Step7: Comparison * If user choice = computer choice print "Tie" increment tota_count value *

If user choice = "paper" and computer choice = "scissor" print "Computer Wins" increment total_count value *

If user choice ="paper" and computer choice="rock" print "User Wins" increment win_count value and total_count value *

If user choice ="scissor" and computer choice="rock" print "Computer Wins" increment total_count value *

If user choice ="scissor" and computer choice="paper" print "User Wins" increment total_count value and win_count value *

If user choice ="rock" and computer choice="paper" print "Computer Wins" increment total_count value *

If user choice ="rock" and computer choice="scissor" print "User Wins" increment total_count value, win_count value *

Step 8: Choice for game continue or quit. If user selects continue, repeat from step 4 Otherwise print user wins against total play and end message python for language comment for each line of code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!