You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Really enjoying your course. So much packed into every lesson, really well done!
Just wanted to comment that when you change the concatenated strings in rps5.py to f-strings I think it should be noted that you can further simplify:
f string allows multiple datatypes so several castings to different variable types can be omitted:
ln 26 player = int(playerchoice)
and computer = int(computerchoice)
the print statements on ln 33, 34 can be shortened:
from: print("\nYou chose {str(RPS(player)).replace('RPS.', '').title()}")
to: print(f"\nYou chose {playerchoice.replace('RPS.', '').title()}")
also print statements ln 62, 63 & 64 do not need the str constructor:
print("\nGame count: {str(game_count)) >> print(f"\nGame count: {game_count}")
The text was updated successfully, but these errors were encountered:
I was wrong about modifying the code referencing the RPS class. Need to leave the str constructor in there or else the names (ROCK....) won't get retrieved and printed.
Really enjoying your course. So much packed into every lesson, really well done!
Just wanted to comment that when you change the concatenated strings in rps5.py to f-strings I think it should be noted that you can further simplify:
f string allows multiple datatypes so several castings to different variable types can be omitted:
ln 26 player = int(playerchoice)
and computer = int(computerchoice)
the print statements on ln 33, 34 can be shortened:
from: print("\nYou chose {str(RPS(player)).replace('RPS.', '').title()}")
to: print(f"\nYou chose {playerchoice.replace('RPS.', '').title()}")
also print statements ln 62, 63 & 64 do not need the str constructor:
print("\nGame count: {str(game_count)) >> print(f"\nGame count: {game_count}")
The text was updated successfully, but these errors were encountered: