Assignment Instructions/ Description
Image transcription textNotice that the sub-list 5,7,9 in the first list appears in the second list whereas there is no 3-element sub-sequence in list A that appears in list C.
The goal of this problem is to write a function that prints the start position in each list for the first 3-element sublist found in both, going left to right:
def search_sublist (X, Y) :
# Determine whether and where a 3-element sub-list of X exists in Y.
A
= [1, 3, 5, 7, 9, 11, 13]
B = [2, 5, 7, 9, 10, 11]
C = [10, 2, 5, 7, 15, 13]
D = [3, 5, 7, 9, 11, 13]
# This should print: Found: at i=4 in X and j=3 in Y
search_sublist (A, B)
# This should print: No 3-element sublist found
search_sublist (A, C)
# This should print: Found: at i=1 in X and j=0 in Y
search_sublist (A, D)... Show more�