Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Python - Code Critique request

Howdy Forum,

I wrote a simple rock, paper, scissors game for Python and I was wondering if I could get some feedback on it. Any thoughts would be appreciated. Thanks!

https://github.com/johndavidsimmons/pythonrps

2 Answers

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

It'd be nice to be told what I can and can't type as a player. Also, you didn't cover the scenario where both the computer and I pick the same choice. Say we both pick 'rock'. You don't have a condition for that.

Your code is pretty clean and nice-looking, though, and I'm always happy to see students building things on their own. Keep going!

Thanks for the feedback Kenneth Love - I tried to cover the same choice scenario on line 40 like so

elif user_choice == computer_choice:
      print("It's a draw, please choose again")
      continue

The next steps I would like to take are: Flexible inputs - for example a user can enter 'y', 'yes', 'ok', etc. to play again A countdown to the decision - The computer chooses, then you choose, then count 1, 2, 3 SHOOT in a smooth way and see who won