Răspuns:
list1 = []
list2 = []
n = int( input("Introduceti lungimea primei liste: ") )
m = int (input("Introduceti lungimea liste numarul doi: "))
for i in range(n):
list1.append(int(input("list1[" + str(i) + "]=")))
for i in range(m):
list2.append(int(input("list2[" + str(i) + "]=")))
print("Prima lista introdusa:")
print(list1)
print("A doua lista introdusa:")
print(list2)
def verify(list1, list2):
if n > m:
difference = n - m
flag = 0
for i in range(difference,n):
if list1[i] == list2[i - difference]:
flag = flag + 1
if flag == m:
return True
else:
return False
else:
return False
print(verify(list1,list2))
Explicație: