PYTHON OR PYTHON 3 PROGRAM FOR GAME STONE, PAPER, SCISSOR
import random
choices = ["stone", "scissor", "paper"]
computer_choice = random.choice(choices)
coputer_score = 0
player_score = 0
while True:
player_choice = input("Enter Your choice from stone, paper, scissor: ")
if computer_choice == player_choice.lower():
print("It is a draw here")
pass
elif computer_choice == "stone" and player_choice.lower() == "paper":
player_score += 1
print("Here Player Wins!!!")
elif computer_choice == "stone" and player_choice.lower() == "scissor":
coputer_score += 1
print("Here Computer Wins!!!")
elif computer_choice == "paper" and player_choice.lower() == "stone":
coputer_score += 1
print("Here Computer Wins!!!")
elif computer_choice == "paper" and player_choice.lower() == "scissor":
player_score += 1
print("Here the player wins!!!")
elif computer_choice == "scissor" and player_choice.lower() == "paper":
coputer_score += 1
print("Here The Computer Wins!!!")
elif computer_choice == "scissor" and player_choice.lower() == "stone":
player_score += 1
print("Here The Player Wins")
elif player_choice.lower() in ["exit","quit","close","end"]:
print("computer score: ",coputer_score)
print("player score: ", player_score)
quit()
Comments
Post a Comment