This project is a simple console based Rock Paper Scissors game where the user plays against the computer. The script demonstrates how to take user input generate a random computer move and compare both choices to decide the winner. It is an excellent beginner friendly example of how conditional logic works in Python.
How the Program Works
- User Input
The game begins by asking the user to enter one of the three options: Rock Paper or Scissors. The choice is stored so it can be compared later.
- Computer Choice
The program then makes the computer pick a move randomly from a predefined list containing Rock Paper and Scissors. This ensures every round is unpredictable.
- Displaying Choices
Both the user’s choice and the computer’s randomly selected choice are displayed so the player can clearly see the match up.
- Winner Logic
The winner is determined by comparing both choices using conditional statements. The logic follows traditional Rock Paper Scissors rules:
- If both choices are the same the result is a draw
- Rock beats Scissors
- Paper beats Rock
- Scissors beats Paper
The program prints whether the user won the computer won or if it ended in a draw.
Understanding the Game Flow
At the top of the script there is an explanation of how each case works such as Rock vs Paper or Paper vs Scissors. This makes it clear to the reader how the game determines outcomes for all scenarios.
Notes and Small Issues to Be Aware Of
- The program is case sensitive. For example typing rock instead of Rock will not match.
- One condition in the win logic uses the word “paper” in lowercase which may cause inconsistency when compared with the uppercase version used elsewhere.
- The script does not validate invalid inputs. If the user types something wrong the program may not behave as expected.
Conclusion
This Rock Paper Scissors script is a simple yet effective demonstration of Python basics including user interaction random choice generation and conditional comparisons. It is ideal for beginners learning how to structure a small game or interactive program. With small improvements like input validation and consistent text formatting it can become even more polished.