I have this python code. Please can you make changes to it to print the same output as shown in the picture!! I need the same output, please!
Here is the code:
PYTHON CODE:
# package for generating random number
import random
# list to store the elements for the game
t = ["rock", "paper", "scissors"]
# function to get the computer's choice
def get_ComputerMove():
# generating a random number
r = random.randint(0,2)
# return the computer's choice
return t[r]
# function to get the player's move
def get_PlayerMove():
# getting user's choice as input
choice = input('Enter "Rock", "Paper" or "Scissors": ')
choice = choice.lower()
# return the choice
return choice
# function to find the winner
def calculate_Winner(c, p):
# displaying the computer's choice
print('Computer choice is', c)
# deciding the winner based on the computer and user's choice
if p == c:
print("Tie!")
elif p == "rock":
if c == "paper":
print("You lose!", c, "covers", p)
else:
print("You win!", p, "smashes", c)
elif p == "paper":
if c == "scissors":
print("You lose!", c, "cut", p)
else:
print("You win!", p, "covers", c)
elif p == "scissors":
if c == "rock":
print("You lose...", c, "smashes", p)
else:
print("You win!", p, "cut", c)
# main function, calls other functions
def main():
# infinite loop
while True:
# calling the various functions
c = get_ComputerMove()
p = get_PlayerMove()
calculate_Winner(c, p)
# testing
if __name__ == '__main__':
# calling the main function
main()
And here is the correct output:
Python 3.6.3 Shell
FileEditShellDebugOptionsWindowHelp
Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
>>>
ctsPxoj6Exexcise5-21.pY
Enter 1 for rock, 2 for paper, 3 for scissors: 1
Computer chose rock
You chose rock
You made the same choice as the computer. Starting over
Enter 1 for rock, 2 for paper, 3 for scissors: 2
Computer chose rock
You chose paper
You win the game
>>>
Ln8Col:0