str1 = "ABCDEF"
I want to find a list of all substrings of length 3 in the above string including overlap For example:
list1 = ['ABC','BCD','CDE','DEF']
I tried the following but it misses the overlap:
n = 3
lst = [str1[i:i+n] for i in range(0, len(str1), n)]