Oct-26-2018, 04:47 PM
I only vaguely looked at your other thread, so forgive me if this is "mean" instead of a "good comment" but:
Line 6 evaluates to 'y', which is probably not what you intended.
Line 12 behaves as it appears you intended, but not for the reasons it looks like. If you change 'y' to 'yes' and play with it you might see why. (Line 64 has the same problem.)
On line 15 you can use random.choice() and skip using an index (I would consider that more elegant, since it skips the implementation detail of the index).
Lines 21 and 22 can be omitted. The other +=0 lines later can be as well.
Line 23 could be even more robust by using
Lines 25 and 30 can be consolidated into a single on between lines 23 and 24.
Your loop on line 56 could/should just be an if, since you
You have logic that looks like the game will restart if a player chooses to do so, but it doesn't actually.
Line 6 evaluates to 'y', which is probably not what you intended.
Line 12 behaves as it appears you intended, but not for the reasons it looks like. If you change 'y' to 'yes' and play with it you might see why. (Line 64 has the same problem.)
On line 15 you can use random.choice() and skip using an index (I would consider that more elegant, since it skips the implementation detail of the index).
Lines 21 and 22 can be omitted. The other +=0 lines later can be as well.
Line 23 could be even more robust by using
player.lower() == "rock"
.Lines 25 and 30 can be consolidated into a single on between lines 23 and 24.
Your loop on line 56 could/should just be an if, since you
break
unconditionally within it. Same with the loop on line 64.You have logic that looks like the game will restart if a player chooses to do so, but it doesn't actually.