On 2018-12-08 10:02, Musatov wrote: > I am thinking about a program where the only user input is > win/loss. The program let's you know if you have won more than 31% > of the time or not. Any suggestions about how to approach authoring > such a program? Thanks. --
Can be done with an awk one-liner: awk '/[wW]/{w+=1}{printf("W: %i L: %i %i%%\n", w, NR-w, w * 100/NR)}END{if (w * 100/NR > 31) print "More than 31% winning"}' -tkc -- https://mail.python.org/mailman/listinfo/python-list