Oct-28-2020, 11:34 AM
If the way your code is indented is the way it is in your code snippet, you just have to indent the lines after your for loop as shown below. Hope that helps =]
def kasinski(text): trigraphs=[] distances=[] for trigraph in range (len(text)-2): newtrigraph= text[trigraph:trigraph+3] if newtrigraph in trigraphs: distances.append(trigraph-(text.index(newtrigraph))) else: trigraphs.append(newtrigraph) trigraphs.append(trigraph) return distances