Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added file #281

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions PYTHON/RockPaperScissors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from random import randint

t = ['rock','paper','scissors']
comp = t[randint(0,2)]
player = False

while player == False:
player = input("Choose one from: rock, paper, scissors\n")
if player == comp:
print('Tie!')
elif player == 'rock':
if comp == 'paper':
print('You LOSE! Paper covers Rock.')
else:
print('You WIN! Scissors cut Paper.')
elif player == 'paper':
if comp == 'rock':
print('You WIN! Paper covers Rock.')
else:
print('You LOSE! Rock destroys Scissors.')
elif player == 'scissors':
if comp == 'paper':
print('You WIN! Scissors cut Paper.')
else:
print('You LOSE! Rock destroys Scissors.')
else:
print('The spelling seems to be incorrect. Kindly check the spelling once!')

player = False
comp = t[randint(0,2)]