Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 6.189 A Gentle Introduction to Programming
- print '***ROCK PAPER SCISSORS***'
- pl1 = raw_input("Enter Player 1's choice: ")
- value1 = pl1.lower() # convert input into lower case
- if value1 == 'rock' or value1 == 'paper' or value1 == 'scissors':
- print 'Player 1: ' + value1
- else:
- print 'Invalid input'
- pl2 = raw_input("Enter Player 2's choice: ")
- value2 = pl2.lower() # convert input into lower case
- if value2 == 'rock' or value2 == 'paper' or value2 == 'scissors':
- print 'Player 2: ' + value2
- else:
- print 'Invalid input'
- if value1 == 'rock' and value2 == 'rock':
- print 'Tie'
- elif value1 == 'rock' and value2 == 'scissors':
- print 'Player 1 wins'
- elif value1 == 'rock' and value2 == 'paper':
- print 'Player 2 wins'
- elif value1 == 'paper' and value2 == 'rock':
- print 'Player 1 wins'
- elif value1 == 'paper' and value2 == 'scissors':
- print 'Player 2 wins'
- elif value1 == 'paper' and value2 == 'paper':
- print 'Tie'
- elif value1 == 'scissors' and value2 == 'rock':
- print 'Player 2 wins'
- elif value1 == 'scissors' and value2 == 'scissors':
- print 'Tie'
- elif value1 == 'scissors' and value2 == 'paper':
- print 'Player 1 wins'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement