The following code works for snaplist.
def snaplist(a):
for i in range(0, len(a)-1):
if a[i] == a[i+1]:
print("Yes")
return
print("No")
a = [3, 4, 4, 8]
snaplist(a)
Your code has:
for i in range(0, len(a)-1-1) and does not work for repeated integers at the end of lists
The following code works for snaplist.
def snaplist(a):
for i in range(0, len(a)-1):
if a[i] == a[i+1]:
print("Yes")
return
print("No")
a = [3, 4, 4, 8]
snaplist(a)
Your code has:
for i in range(0, len(a)-1-1) and does not work for repeated integers at the end of lists