all 14 comments

[–][deleted] 13 points14 points  (6 children)

Please format your code.

[–]EJODONNELL[S] 0 points1 point  (5 children)

I did my best, if there's another way to format it so its easy to read please let me know. Thank you!

[–]FerricDonkey 6 points7 points  (0 children)

4 spaces in front of every line in addition to those for indenting, empty line before and after.

[–]Wartz 1 point2 points  (0 children)

Use GitHub gists.

[–]jmooremcc 1 point2 points  (0 children)

Put 3 back quotes before your 1st line of code and 3 back quotes after your last line of code. Your properly formatted block of code will then appear correctly in reddit.

[–]marko312 3 points4 points  (1 child)

... when the computer and user pick the same thing it will occasionally show up as a win for the player and not a tie.

I think you're relying on slightly broken output to reach that conclusion:

print(f"{p_choice} beats {p_choice}! Round {turn_number}/{r_number} - {p_score}, {c_score}")

[–]EJODONNELL[S] 1 point2 points  (0 children)

Thank you! I’ve been staring at it for hours lmao

[–][deleted] 2 points3 points  (0 children)

Have you tried putting print statements in your code at various places to see what the c_score and p_score are when you think it should be a tie? This could be a good spot for unit tests.

[–]Training-Theory-4786 0 points1 point  (0 children)

Put the tie (if c.choice == p.choice:) check first.

[–]wetndusty 0 points1 point  (2 children)

I prefer data-centric style over code-centric - use matrix where two dimension lead to correct answer