Code:
from __future__ import print_function
import random
oddCount= 0
for s in range(100):
    spinCount= s
    n= random.randrange(38)
    # Zero
    if n == 0 or n == 37: # treat 37 as 00
        oddCount = 0
        continue
    # Odd
    if n%2 == 1:
        oddCount += 1
        if oddCount == 6: break
        continue
    # Even
    assert n%2 == 0 and 0 < n <= 36
    oddCount = 0
print( oddCount, spinCount )
What's bugging me is the "or n == 37" , also, why treat 37 as 0? What am i missing?
This program is supposed to either roll 100 times or stop if we get 6 odd numbers in a row, and, it's from "Building Skills With Python" book


edit --------

Sorry people, i just found out what the 37 is all about. No Casinos at my country lol.