findSubs = lambda s, v: [''.join([s[i + j] for j in range(v)]) for i, x in
    enumerate(s) if i <= len(s) - v]
findCount = lambda s, v: len(findSubs(s, v))
print(findSubs('ABCDEFG', 5))
print(findCount('ABCDEFG', 5))
Counting the number of different 5 characters substrings inside a string