I am almost done with similarities I think. Can't really figure out what is wrong with my substrings
def substrings(a, b, n):
"""Return substrings of length n in both a and b"""
x = []
y = []
for i in range(len(a) - n + 1):
lista = set(x.append(a[i:i+n]))
for i in range(len(b) - n + 1):
listb = set(y.append(b[i:i+n]))
return lista & listb
Can someone help me out? My errors are
'NoneType' object is not iterable
local variable 'lista' referenced before assignment.
Thank you.