Granted I'm no Pythonista, but I have a little script I wrote years ago in Python 2.7 and again in 3....,uh, 3.8 now. IPython 3.8.10, that is. Use it daily for about 15 years now. Anyway, I wanted to reproduce this gist, due to a fascination with Bayes... I think there is a code step missing. I typed everything in up to the first updated probability distribution. Where the gist shows [0.0, 0.018181818181818184, 0.03636363636363637, 0.05454545454545454, etc..], my repl returns [0.018181818181818184,0.018181818181818184,...0.018181818181818184]. I could tease out how to assign P(m[1])=0 for drawing a red ball, fill in the missing step, but I'll save that for after I Learn Python The Hard Way :)