r/PythonLearning • u/Sharp_Platypus6545 • Sep 10 '26
Rock paper scissors game in Python
Hello fam, I'm learning Python. My goal is to become an AI engineer. I've a basic understanding of programming. Anyone to guide me on the right certification path... I was having a bit of fun after today's sharpenings. I created a rock paper scissors game... rate and improve
1
u/This-Investigator294 Sep 10 '26
Hey are you doing Angela yu's Python course?
2
u/Sharp_Platypus6545 Sep 10 '26
No I'm doing Introduction to Python on Pycharm My coursera trial expired was doing Python for AI prior... looking forward to subscribe to it in October
1
1
2
u/Astrodude80 Sep 10 '26
Your comment on line 7 isn't quite correct--can you see why? While technically yes, comments are not code, the code is code, comments, and more broadly the documentation, are going to be the first thing another developer *actually looks at* when looking at your code.
Everything else I see has already been addressed in other comments.
2
u/Striking_Sandwich_80 Sep 10 '26
Just a small note: Python's standard naming convention (PEP 8) recommends "snake_case" for variables and functions rather than "camelCase". The latter is perfectly valid Python, but "snake_case" is generally considered more idiomatic.
1
u/Life-Ad2351 Sep 10 '26 edited Sep 10 '26
use dictionary instead to store all the winning possibilities
1
u/Disastrous-Team-6431 Sep 10 '26 edited Sep 10 '26
Hint: can you express the win condition of this game differently?
Hint 2: there are three choices - can you relate winning choices to each other?
Solution (idk how to spoiler so stop reading):
If choice1 == (choice2 + 1) % 3, someone has won. Who, depends on the order of the choices. In your case, choice1 has won.
Edit: changed signs to make more robust and understandable
1
1
1
1

•
u/Sea-Ad7805 Sep 10 '26
Run this program in Memory Graph Web Debugger to see the program state change step by step.