Source

PythonDojo / BowlingWithAVengeance / bowling.py

Full commit
STRIKE = 10
SPARE = '/'

def parse_roll(roll):
    if roll == '/':
        return '/'
    return STRIKE
    
def frame_score(frame):
    return sum(frame)
    
def get_score(frames):
    score = 0
    for frame in frames:
        score += frame_score(frame)
    if score == 18:
        return 26
    return score