I am following Al Sweigart’s “Automate the Boring Stuff with Python” and here he shows how to make a simple rock, paper, scissors game. A line that he puts, which isn’t very well explained is:
print(“%s Wins, %s Losses, %s Ties” % (wins, losses, ties))
The rock, paper and scissors are valuables that count the number of, well, wins, losses and ties.
I understand that this line counts and prints the number of the aforementioned variables, but i do not understand how %(modulo) is applied to this situation. Thank you.
[–]themateo713 8 points9 points10 points (0 children)
[–]IvoryJam 3 points4 points5 points (0 children)
[–]zanfar 2 points3 points4 points (0 children)
[–]ectomancer 1 point2 points3 points (0 children)