def frequency_table(text, k):
    """returns frequency table for k_mers of length k in the text"""
    d = {}
    i = 0
    while i <= len(text)-k:
        pattern = text[i:i+k]
        d[pattern] = d.get(pattern, 0) + 1
        i = i+1
    return d