Answer To: Design a python program that simulates the game rock, paper, and scissors. You are to keep track of...
Pratap answered on Mar 14 2021
#Import libraries
from termcolor import colored
from random import randint
#Initial variable declaration
win = 0
lost = 0
tie = 0
win_streak = 0
loose_streak = 0
long_win_streak = []
long_loose_streak = []
#Main menu function of the program
def main_menu():
#Display the menu options
print(
colored("\nMENU:\n", "red", attrs=['bold']),
colored("1. Throw Rock\n", "green", attrs=['bold']),
colored("2. Throw Paper\n", "green", attrs=['bold']),
colored("3. Throw Scissor\n", "green", attrs=['bold']),
colored("4. Quit", "green", attrs=['bold'])
)
try:
#Capture user input from the menu
choice = int(input("Please select a option number from the menu: "))
return choice
except:
#Handle invalid input entry
print(colored("\nInvalid Entry Type!!", "red", attrs=['bold']))
user_query()
#Result display function
def display_result(out, human, computer):
#Use global variables from initial declaration
global win, lost, tie, win_streak, loose_streak,...