Ways to decode digits

Letters were encoded as numbers, A = 1 through Z = 26, and the digits concatenated. Write decode_ways(digits) that returns how many ways the digit string can be decoded. A 0 can only be part of 10 or 20.

decode_ways("12")   ->  2     (AB or L)
decode_ways("226")  ->  3     (BZ, VF, BBF)
decode_ways("06")   ->  0

The point is to practise a DP over string prefixes with two possible last steps.

def decode_ways(digits):
    ...